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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 1983803002: Added notification when user presses backspace to use new shortcut. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@subtle-notification-view-refactor
Patch Set: Respond to pkasting review. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 5be5b95280c0da1d5cc8d380374d1497212aa71b..358419c09665b68732727bcbec717358005e8292 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -978,12 +978,19 @@ void BrowserView::UpdateExclusiveAccessExitBubbleContent(
if (bubble_type == EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE ||
ShouldUseImmersiveFullscreenForUrl(url)) {
exclusive_access_bubble_.reset();
- } else if (exclusive_access_bubble_.get()) {
+ return;
+ }
+
+ // Hide the backspace shortcut bubble, to avoid overlapping.
+ new_back_shortcut_bubble_.reset();
+
+ if (exclusive_access_bubble_) {
exclusive_access_bubble_->UpdateContent(url, bubble_type);
- } else {
- exclusive_access_bubble_.reset(
- new ExclusiveAccessBubbleViews(this, url, bubble_type));
+ return;
}
+
+ exclusive_access_bubble_.reset(
+ new ExclusiveAccessBubbleViews(this, url, bubble_type));
}
void BrowserView::OnExclusiveAccessUserInput() {
@@ -1007,6 +1014,18 @@ bool BrowserView::IsFullscreenBubbleVisible() const {
return exclusive_access_bubble_ != nullptr;
}
+void BrowserView::ShowNewBackShortcutBubble(bool forward) {
+ // Hide the exclusive access bubble, to avoid overlapping.
+ exclusive_access_bubble_.reset();
+
+ if (new_back_shortcut_bubble_) {
+ new_back_shortcut_bubble_->UpdateContent(forward);
+ return;
+ }
+
+ new_back_shortcut_bubble_.reset(new NewBackShortcutBubble(this, forward));
Peter Kasting 2016/05/24 23:35:08 Nit: Shorter: if (new_back_shortcut_bubble_)
Matt Giuca 2016/05/26 04:37:34 Well there's a general (unwritten) rule in Chromiu
Peter Kasting 2016/05/26 05:19:40 Huh, really? I ask for early returns in cases whe
Matt Giuca 2016/05/26 06:05:39 Oh OK. Well I think some people take the "no else
+}
+
void BrowserView::RestoreFocus() {
WebContents* selected_web_contents = GetActiveWebContents();
if (selected_web_contents)

Powered by Google App Engine
This is Rietveld 408576698