Commit eb900126 authored by Marina Ciocea's avatar Marina Ciocea Committed by Commit Bot

Disable contents border for shared tab on Mac.

Drive-by fix crash when the browser is closed while sharing a tab.

Bug: 991896
Change-Id: I00fe5791cd6856f8258a279a7fa5f6e7d276237f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1746169
Commit-Queue: Marina Ciocea <marinaciocea@chromium.org>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685533}
parent 46f63a50
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
namespace { namespace {
#if !defined(OS_MACOSX)
const int kContentsBorderThickness = 10; const int kContentsBorderThickness = 10;
const float kContentsBorderOpacity = 0.24; const float kContentsBorderOpacity = 0.24;
const SkColor kContentsBorderColor = gfx::kGoogleBlue500; const SkColor kContentsBorderColor = gfx::kGoogleBlue500;
...@@ -68,8 +69,11 @@ void InitContentsBorderWidget(content::WebContents* contents) { ...@@ -68,8 +69,11 @@ void InitContentsBorderWidget(content::WebContents* contents) {
browser_view->set_contents_border_widget(widget); browser_view->set_contents_border_widget(widget);
} }
#endif
void SetContentsBorderVisible(content::WebContents* contents, bool visible) { void SetContentsBorderVisible(content::WebContents* contents, bool visible) {
if (!contents)
return;
Browser* browser = chrome::FindBrowserWithWebContents(contents); Browser* browser = chrome::FindBrowserWithWebContents(contents);
if (!browser) if (!browser)
return; return;
...@@ -108,7 +112,10 @@ TabSharingUIViews::TabSharingUIViews(const content::DesktopMediaID& media_id, ...@@ -108,7 +112,10 @@ TabSharingUIViews::TabSharingUIViews(const content::DesktopMediaID& media_id,
media_id.web_contents_id.main_render_frame_id)); media_id.web_contents_id.main_render_frame_id));
shared_tab_name_ = GetTabName(shared_tab_); shared_tab_name_ = GetTabName(shared_tab_);
profile_ = ProfileManager::GetLastUsedProfileAllowedByPolicy(); profile_ = ProfileManager::GetLastUsedProfileAllowedByPolicy();
#if !defined(OS_MACOSX)
// TODO(https://crbug.com/991896) fix contents border on Mac.
InitContentsBorderWidget(shared_tab_); InitContentsBorderWidget(shared_tab_);
#endif
} }
TabSharingUIViews::~TabSharingUIViews() { TabSharingUIViews::~TabSharingUIViews() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment