| 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 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1183 if (immersive_mode_controller_->ShouldHideTopViews()) | 1183 if (immersive_mode_controller_->ShouldHideTopViews()) |
| 1184 return false; | 1184 return false; |
| 1185 // It's possible to reach here before we've been notified of being added to a | 1185 // It's possible to reach here before we've been notified of being added to a |
| 1186 // widget, so |toolbar_| is still null. Return false in this case so callers | 1186 // widget, so |toolbar_| is still null. Return false in this case so callers |
| 1187 // don't assume they can access the toolbar yet. | 1187 // don't assume they can access the toolbar yet. |
| 1188 return (browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) || | 1188 return (browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) || |
| 1189 browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) && | 1189 browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) && |
| 1190 toolbar_; | 1190 toolbar_; |
| 1191 } | 1191 } |
| 1192 | 1192 |
| 1193 bool BrowserView::IsToolbarShowing() const { |
| 1194 return IsToolbarVisible(); |
| 1195 } |
| 1196 |
| 1193 void BrowserView::ShowUpdateChromeDialog() { | 1197 void BrowserView::ShowUpdateChromeDialog() { |
| 1194 UpdateRecommendedMessageBox::Show(GetNativeWindow()); | 1198 UpdateRecommendedMessageBox::Show(GetNativeWindow()); |
| 1195 } | 1199 } |
| 1196 | 1200 |
| 1197 void BrowserView::ShowBookmarkBubble(const GURL& url, bool already_bookmarked) { | 1201 void BrowserView::ShowBookmarkBubble(const GURL& url, bool already_bookmarked) { |
| 1198 toolbar_->ShowBookmarkBubble(url, already_bookmarked, | 1202 toolbar_->ShowBookmarkBubble(url, already_bookmarked, |
| 1199 bookmark_bar_view_.get()); | 1203 bookmark_bar_view_.get()); |
| 1200 } | 1204 } |
| 1201 | 1205 |
| 1202 void BrowserView::ShowBookmarkAppBubble( | 1206 void BrowserView::ShowBookmarkAppBubble( |
| (...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2684 } | 2688 } |
| 2685 | 2689 |
| 2686 extensions::ActiveTabPermissionGranter* | 2690 extensions::ActiveTabPermissionGranter* |
| 2687 BrowserView::GetActiveTabPermissionGranter() { | 2691 BrowserView::GetActiveTabPermissionGranter() { |
| 2688 content::WebContents* web_contents = GetActiveWebContents(); | 2692 content::WebContents* web_contents = GetActiveWebContents(); |
| 2689 if (!web_contents) | 2693 if (!web_contents) |
| 2690 return nullptr; | 2694 return nullptr; |
| 2691 return extensions::TabHelper::FromWebContents(web_contents) | 2695 return extensions::TabHelper::FromWebContents(web_contents) |
| 2692 ->active_tab_permission_granter(); | 2696 ->active_tab_permission_granter(); |
| 2693 } | 2697 } |
| OLD | NEW |