diff --git a/browser/ui/BUILD.gn b/browser/ui/BUILD.gn index 0526a2133c36..28b6e837afef 100644 --- a/browser/ui/BUILD.gn +++ b/browser/ui/BUILD.gn @@ -42,8 +42,6 @@ source_set("ui") { "views/brave_actions/brave_action_view.h", "views/brave_actions/brave_actions_container.cc", "views/brave_actions/brave_actions_container.h", - "views/brave_status_bubble_views.cc", - "views/brave_status_bubble_views.h", "views/download/brave_download_item_view.cc", "views/download/brave_download_item_view.h", "views/frame/brave_browser_view.cc", diff --git a/browser/ui/views/brave_status_bubble_views.cc b/browser/ui/views/brave_status_bubble_views.cc deleted file mode 100644 index fc27056992ac..000000000000 --- a/browser/ui/views/brave_status_bubble_views.cc +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (c) 2019 The Brave Authors. All rights reserved. - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "brave/browser/ui/views/brave_status_bubble_views.h" - -#include "content/public/common/url_constants.h" -#include "url/gurl.h" - -void BraveStatusBubbleViews::SetURL(const GURL& url) { - GURL revised_url = url; - if (revised_url.SchemeIs(content::kChromeUIScheme)) { - GURL::Replacements replacements; - replacements.SetSchemeStr(content::kBraveUIScheme); - revised_url = revised_url.ReplaceComponents(replacements); - } - - StatusBubbleViews::SetURL(revised_url); -} diff --git a/browser/ui/views/brave_status_bubble_views.h b/browser/ui/views/brave_status_bubble_views.h deleted file mode 100644 index 1164515d51a8..000000000000 --- a/browser/ui/views/brave_status_bubble_views.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (c) 2019 The Brave Authors. All rights reserved. - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef BRAVE_BROWSER_UI_VIEWS_BRAVE_STATUS_BUBBLE_VIEWS_H_ -#define BRAVE_BROWSER_UI_VIEWS_BRAVE_STATUS_BUBBLE_VIEWS_H_ - -#include "chrome/browser/ui/views/status_bubble_views.h" - -class BraveStatusBubbleViews : public StatusBubbleViews { - public: - using StatusBubbleViews::StatusBubbleViews; - ~BraveStatusBubbleViews() override = default; - - // StatusBubbleViews overrides: - void SetURL(const GURL& url) override; - - private: - DISALLOW_COPY_AND_ASSIGN(BraveStatusBubbleViews); -}; - -#endif // BRAVE_BROWSER_UI_VIEWS_BRAVE_STATUS_BUBBLE_VIEWS_H_ diff --git a/browser/ui/views/brave_status_bubble_views_unittest.cc b/browser/ui/views/brave_status_bubble_views_unittest.cc deleted file mode 100644 index b5a4f06b75c6..000000000000 --- a/browser/ui/views/brave_status_bubble_views_unittest.cc +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (c) 2019 The Brave Authors. All rights reserved. - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "brave/browser/ui/views/brave_status_bubble_views.h" - -#include "chrome/test/views/chrome_views_test_base.h" -#include "ui/views/widget/widget.h" - -class BraveStatusBubbleViewsTest : public ChromeViewsTestBase { - protected: - // ChromeViewsTestBase overrides: - void SetUp() override { - ChromeViewsTestBase::SetUp(); - CreateWidget(); - } - - void TearDown() override { - if (widget_ && !widget_->IsClosed()) - widget_->Close(); - - ChromeViewsTestBase::TearDown(); - } - - views::Widget* widget() const { - return widget_; - } - - private: - void CreateWidget() { - DCHECK(!widget_); - widget_ = new views::Widget; - views::Widget::InitParams params = - CreateParams(views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); - widget_->Init(params); - } - - views::Widget* widget_ = nullptr; -}; - -TEST_F(BraveStatusBubbleViewsTest, SetURLTest) { - BraveStatusBubbleViews bubble(widget()->GetContentsView()); - bubble.SetURL(GURL("chrome://settings/")); - EXPECT_EQ(GURL("brave://settings/"), bubble.url_); - - const GURL brave_url("https://www.brave.com/"); - bubble.SetURL(brave_url); - EXPECT_EQ(brave_url, bubble.url_); -} diff --git a/chromium_src/chrome/browser/ui/views/frame/browser_view.cc b/chromium_src/chrome/browser/ui/views/frame/browser_view.cc index 995078a979f3..ea81583cbafb 100644 --- a/chromium_src/chrome/browser/ui/views/frame/browser_view.cc +++ b/chromium_src/chrome/browser/ui/views/frame/browser_view.cc @@ -1,13 +1,6 @@ -/* Copyright (c) 2019 The Brave Authors. All rights reserved. - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - #include "chrome/browser/ui/views/toolbar/toolbar_view.h" -#include "brave/browser/ui/views/brave_status_bubble_views.h" #include "brave/browser/ui/views/toolbar/brave_toolbar_view.h" #define ToolbarView BraveToolbarView -#define StatusBubbleViews BraveStatusBubbleViews -#include "../../../../../../../chrome/browser/ui/views/frame/browser_view.cc" // NOLINT +#include "../../../../../../../chrome/browser/ui/views/frame/browser_view.cc" \ No newline at end of file diff --git a/patches/chrome-browser-ui-views-status_bubble_views.h.patch b/patches/chrome-browser-ui-views-status_bubble_views.h.patch deleted file mode 100644 index eeda7824cf2f..000000000000 --- a/patches/chrome-browser-ui-views-status_bubble_views.h.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/chrome/browser/ui/views/status_bubble_views.h b/chrome/browser/ui/views/status_bubble_views.h -index 60e3dc23b6026eca189935fe8987aae1cf134e43..a29f5f67072b110157221ce7b645f237b1a478ef 100644 ---- a/chrome/browser/ui/views/status_bubble_views.h -+++ b/chrome/browser/ui/views/status_bubble_views.h -@@ -73,6 +73,9 @@ class StatusBubbleViews : public StatusBubble { - void MouseMovedAt(const gfx::Point& location, bool left_content); - - private: -+#if defined(BRAVE_CHROMIUM_BUILD) -+ FRIEND_TEST_ALL_PREFIXES(BraveStatusBubbleViewsTest, SetURLTest); -+#endif - class StatusView; - class StatusViewAnimation; - class StatusViewExpander; diff --git a/test/BUILD.gn b/test/BUILD.gn index b6949ba9d38e..c6c56d685530 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -42,7 +42,6 @@ test("brave_unit_tests") { "//brave/browser/brave_resources_util_unittest.cc", "//brave/browser/brave_stats_updater_unittest.cc", "//brave/browser/download/brave_download_item_model_unittest.cc", - "//brave/browser/ui/views/brave_status_bubble_views_unittest.cc", "//brave/browser/tor/mock_tor_profile_service_impl.cc", "//brave/browser/tor/mock_tor_profile_service_impl.h", "//brave/browser/tor/mock_tor_profile_service_factory.cc",