OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include "chrome/browser/ui/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
978 | 978 |
979 void BrowserView::UpdateExclusiveAccessExitBubbleContent( | 979 void BrowserView::UpdateExclusiveAccessExitBubbleContent( |
980 const GURL& url, | 980 const GURL& url, |
981 ExclusiveAccessBubbleType bubble_type) { | 981 ExclusiveAccessBubbleType bubble_type) { |
982 // Immersive mode has no exit bubble because it has a visible strip at the | 982 // Immersive mode has no exit bubble because it has a visible strip at the |
983 // top that gives the user a hover target. | 983 // top that gives the user a hover target. |
984 // TODO(jamescook): Figure out what to do with mouse-lock. | 984 // TODO(jamescook): Figure out what to do with mouse-lock. |
985 if (bubble_type == EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE || | 985 if (bubble_type == EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE || |
986 ShouldUseImmersiveFullscreenForUrl(url)) { | 986 ShouldUseImmersiveFullscreenForUrl(url)) { |
987 exclusive_access_bubble_.reset(); | 987 exclusive_access_bubble_.reset(); |
988 } else if (exclusive_access_bubble_.get()) { | 988 return; |
989 } | |
990 | |
991 // Hide the backspace shortcut bubble, to avoid overlapping. | |
992 backspace_new_shortcut_bubble_.reset(); | |
993 | |
994 if (exclusive_access_bubble_.get()) { | |
Peter Kasting
2016/05/19 10:08:37
Nit: .get() not necessary
Matt Giuca
2016/05/23 04:22:57
Done.
| |
989 exclusive_access_bubble_->UpdateContent(url, bubble_type); | 995 exclusive_access_bubble_->UpdateContent(url, bubble_type); |
990 } else { | 996 return; |
991 exclusive_access_bubble_.reset( | |
992 new ExclusiveAccessBubbleViews(this, url, bubble_type)); | |
993 } | 997 } |
998 | |
999 exclusive_access_bubble_.reset( | |
1000 new ExclusiveAccessBubbleViews(this, url, bubble_type)); | |
994 } | 1001 } |
995 | 1002 |
996 void BrowserView::OnExclusiveAccessUserInput() { | 1003 void BrowserView::OnExclusiveAccessUserInput() { |
997 if (exclusive_access_bubble_.get()) | 1004 if (exclusive_access_bubble_.get()) |
998 exclusive_access_bubble_->OnUserInput(); | 1005 exclusive_access_bubble_->OnUserInput(); |
999 } | 1006 } |
1000 | 1007 |
1001 bool BrowserView::ShouldHideUIForFullscreen() const { | 1008 bool BrowserView::ShouldHideUIForFullscreen() const { |
1002 // Immersive mode needs UI for the slide-down top panel. | 1009 // Immersive mode needs UI for the slide-down top panel. |
1003 if (immersive_mode_controller_->IsEnabled()) | 1010 if (immersive_mode_controller_->IsEnabled()) |
(...skipping 14 matching lines...) Expand all Loading... | |
1018 WebContents* selected_web_contents = GetActiveWebContents(); | 1025 WebContents* selected_web_contents = GetActiveWebContents(); |
1019 if (selected_web_contents) | 1026 if (selected_web_contents) |
1020 selected_web_contents->RestoreFocus(); | 1027 selected_web_contents->RestoreFocus(); |
1021 } | 1028 } |
1022 | 1029 |
1023 void BrowserView::FullscreenStateChanged() { | 1030 void BrowserView::FullscreenStateChanged() { |
1024 CHECK(!IsFullscreen()); | 1031 CHECK(!IsFullscreen()); |
1025 ProcessFullscreen(false, GURL(), EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE); | 1032 ProcessFullscreen(false, GURL(), EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE); |
1026 } | 1033 } |
1027 | 1034 |
1035 void BrowserView::ShowBackspaceNewShortcutBubble(bool forward) { | |
Peter Kasting
2016/05/19 10:08:37
Nit: Function definition order must match the decl
Matt Giuca
2016/05/23 04:22:57
There is already significant discrepancy between t
Peter Kasting
2016/05/24 23:35:08
Yeah :(
I would love to see a CL that fixes all o
| |
1036 // Hide the exclusive access bubble, to avoid overlapping. | |
1037 exclusive_access_bubble_.reset(); | |
1038 | |
1039 if (backspace_new_shortcut_bubble_.get()) { | |
Peter Kasting
2016/05/19 10:08:37
Nit: .get() not necessary
Matt Giuca
2016/05/23 04:22:57
Done.
| |
1040 backspace_new_shortcut_bubble_->UpdateContent(forward); | |
1041 return; | |
1042 } | |
1043 | |
1044 backspace_new_shortcut_bubble_.reset( | |
1045 new BackspaceNewShortcutBubble(this, forward)); | |
1046 } | |
1047 | |
1028 LocationBar* BrowserView::GetLocationBar() const { | 1048 LocationBar* BrowserView::GetLocationBar() const { |
1029 return GetLocationBarView(); | 1049 return GetLocationBarView(); |
1030 } | 1050 } |
1031 | 1051 |
1032 void BrowserView::SetFocusToLocationBar(bool select_all) { | 1052 void BrowserView::SetFocusToLocationBar(bool select_all) { |
1033 // On Windows, changing focus to the location bar causes the browser | 1053 // On Windows, changing focus to the location bar causes the browser |
1034 // window to become active. This can steal focus if the user has | 1054 // window to become active. This can steal focus if the user has |
1035 // another window open already. On ChromeOS, changing focus makes a | 1055 // another window open already. On ChromeOS, changing focus makes a |
1036 // view believe it has a focus even if the widget doens't have a | 1056 // view believe it has a focus even if the widget doens't have a |
1037 // focus. Either cases, we need to ignore this when the browser | 1057 // focus. Either cases, we need to ignore this when the browser |
(...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2636 } | 2656 } |
2637 | 2657 |
2638 extensions::ActiveTabPermissionGranter* | 2658 extensions::ActiveTabPermissionGranter* |
2639 BrowserView::GetActiveTabPermissionGranter() { | 2659 BrowserView::GetActiveTabPermissionGranter() { |
2640 content::WebContents* web_contents = GetActiveWebContents(); | 2660 content::WebContents* web_contents = GetActiveWebContents(); |
2641 if (!web_contents) | 2661 if (!web_contents) |
2642 return nullptr; | 2662 return nullptr; |
2643 return extensions::TabHelper::FromWebContents(web_contents) | 2663 return extensions::TabHelper::FromWebContents(web_contents) |
2644 ->active_tab_permission_granter(); | 2664 ->active_tab_permission_granter(); |
2645 } | 2665 } |
OLD | NEW |