Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(845)

Side by Side Diff: chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.mm

Issue 2063103002: Fixed overlapping subtle notifications on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.h" 5 #import "chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.h"
6 6
7 #include "chrome/browser/download/download_shelf.h" 7 #include "chrome/browser/download/download_shelf.h"
8 #include "chrome/browser/fullscreen.h" 8 #include "chrome/browser/fullscreen.h"
9 #include "chrome/browser/ui/browser_window.h" 9 #include "chrome/browser/ui/browser_window.h"
10 #include "chrome/browser/ui/cocoa/accelerators_cocoa.h" 10 #include "chrome/browser/ui/cocoa/accelerators_cocoa.h"
(...skipping 18 matching lines...) Expand all
29 pref_registrar_.Add( 29 pref_registrar_.Add(
30 prefs::kShowFullscreenToolbar, 30 prefs::kShowFullscreenToolbar,
31 base::Bind(&ExclusiveAccessController::UpdateFullscreenToolbar, 31 base::Bind(&ExclusiveAccessController::UpdateFullscreenToolbar,
32 base::Unretained(this))); 32 base::Unretained(this)));
33 } 33 }
34 34
35 ExclusiveAccessController::~ExclusiveAccessController() {} 35 ExclusiveAccessController::~ExclusiveAccessController() {}
36 36
37 void ExclusiveAccessController::Show() { 37 void ExclusiveAccessController::Show() {
38 if (ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) { 38 if (ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) {
39 // Hide the backspace shortcut bubble, to avoid overlapping.
40 new_back_shortcut_bubble_.reset();
41
39 views_bubble_.reset( 42 views_bubble_.reset(
40 new ExclusiveAccessBubbleViews(this, url_, bubble_type_)); 43 new ExclusiveAccessBubbleViews(this, url_, bubble_type_));
41 return; 44 return;
42 } 45 }
43 46
44 [cocoa_bubble_ closeImmediately]; 47 [cocoa_bubble_ closeImmediately];
45 cocoa_bubble_.reset([[ExclusiveAccessBubbleWindowController alloc] 48 cocoa_bubble_.reset([[ExclusiveAccessBubbleWindowController alloc]
46 initWithOwner:controller_ 49 initWithOwner:controller_
47 exclusive_access_manager:browser_->exclusive_access_manager() 50 exclusive_access_manager:browser_->exclusive_access_manager()
48 profile:browser_->profile() 51 profile:browser_->profile()
49 url:url_ 52 url:url_
50 bubbleType:bubble_type_]); 53 bubbleType:bubble_type_]);
51 [cocoa_bubble_ showWindow]; 54 [cocoa_bubble_ showWindow];
52 } 55 }
53 56
54 void ExclusiveAccessController::ShowNewBackShortcutBubble(bool forward) { 57 void ExclusiveAccessController::ShowNewBackShortcutBubble(bool forward) {
58 // Hide the exclusive access bubble, to avoid overlapping.
59 views_bubble_.reset();
60
55 if (new_back_shortcut_bubble_) 61 if (new_back_shortcut_bubble_)
56 new_back_shortcut_bubble_->UpdateContent(forward); 62 new_back_shortcut_bubble_->UpdateContent(forward);
57 else 63 else
58 new_back_shortcut_bubble_.reset(new NewBackShortcutBubble(this, forward)); 64 new_back_shortcut_bubble_.reset(new NewBackShortcutBubble(this, forward));
59 } 65 }
60 66
61 void ExclusiveAccessController::Destroy() { 67 void ExclusiveAccessController::Destroy() {
62 views_bubble_.reset(); 68 views_bubble_.reset();
63 [cocoa_bubble_ closeImmediately]; 69 [cocoa_bubble_ closeImmediately];
64 cocoa_bubble_.reset(); 70 cocoa_bubble_.reset();
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 197 }
192 198
193 gfx::Rect ExclusiveAccessController::GetTopContainerBoundsInScreen() { 199 gfx::Rect ExclusiveAccessController::GetTopContainerBoundsInScreen() {
194 NOTREACHED(); // Only used for ImmersiveMode. 200 NOTREACHED(); // Only used for ImmersiveMode.
195 return gfx::Rect(); 201 return gfx::Rect();
196 } 202 }
197 203
198 BrowserWindow* ExclusiveAccessController::GetBrowserWindow() const { 204 BrowserWindow* ExclusiveAccessController::GetBrowserWindow() const {
199 return [controller_ browserWindow]; 205 return [controller_ browserWindow];
200 } 206 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698