-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove duplicated separator in page context menu
fixes brave/brave-browser#15714 RemoveAdjacentSeparators::RenderViewContextMenuBase is used
- Loading branch information
1 parent
1e48647
commit bbf834e
Showing
5 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
browser/ui/views/tab_contents/brave_web_contents_view_delegate_views.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* Copyright (c) 2021 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/tab_contents/brave_web_contents_view_delegate_views.h" | ||
|
||
#include <memory> | ||
#include <utility> | ||
|
||
#include "chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.h" | ||
#include "components/renderer_context_menu/render_view_context_menu_base.h" | ||
|
||
BraveWebContentsViewDelegateViews::BraveWebContentsViewDelegateViews( | ||
content::WebContents* web_contents) | ||
: ChromeWebContentsViewDelegateViews(web_contents) {} | ||
|
||
BraveWebContentsViewDelegateViews::~BraveWebContentsViewDelegateViews() = | ||
default; | ||
|
||
void BraveWebContentsViewDelegateViews::ShowMenu( | ||
std::unique_ptr<RenderViewContextMenuBase> menu) { | ||
menu->RemoveAdjacentSeparators(); | ||
ChromeWebContentsViewDelegateViews::ShowMenu(std::move(menu)); | ||
} |
29 changes: 29 additions & 0 deletions
29
browser/ui/views/tab_contents/brave_web_contents_view_delegate_views.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* Copyright (c) 2021 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_TAB_CONTENTS_BRAVE_WEB_CONTENTS_VIEW_DELEGATE_VIEWS_H_ | ||
#define BRAVE_BROWSER_UI_VIEWS_TAB_CONTENTS_BRAVE_WEB_CONTENTS_VIEW_DELEGATE_VIEWS_H_ | ||
|
||
#include <memory> | ||
|
||
#include "chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.h" | ||
|
||
class RenderViewContextMenuBase; | ||
|
||
namespace content { | ||
class WebContents; | ||
} | ||
|
||
class BraveWebContentsViewDelegateViews | ||
: public ChromeWebContentsViewDelegateViews { | ||
public: | ||
explicit BraveWebContentsViewDelegateViews( | ||
content::WebContents* web_contents); | ||
~BraveWebContentsViewDelegateViews() override; | ||
|
||
void ShowMenu(std::unique_ptr<RenderViewContextMenuBase> menu) override; | ||
}; | ||
|
||
#endif // BRAVE_BROWSER_UI_VIEWS_TAB_CONTENTS_BRAVE_WEB_CONTENTS_VIEW_DELEGATE_VIEWS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
chromium_src/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* Copyright (c) 2021 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/tab_contents/brave_web_contents_view_delegate_views.h" | ||
|
||
#define CreateWebContentsViewDelegate CreateWebContentsViewDelegate_ChromiumImpl | ||
#include "../../../../../../../chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc" | ||
#undef CreateWebContentsViewDelegate | ||
|
||
content::WebContentsViewDelegate* CreateWebContentsViewDelegate( | ||
content::WebContents* web_contents) { | ||
return new BraveWebContentsViewDelegateViews(web_contents); | ||
} |