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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 LoadingAnimationCallback(); | 848 LoadingAnimationCallback(); |
849 } | 849 } |
850 } | 850 } |
851 } | 851 } |
852 | 852 |
853 void BrowserView::SetStarredState(bool is_starred) { | 853 void BrowserView::SetStarredState(bool is_starred) { |
854 GetLocationBarView()->SetStarToggled(is_starred); | 854 GetLocationBarView()->SetStarToggled(is_starred); |
855 } | 855 } |
856 | 856 |
857 void BrowserView::SetTranslateIconToggled(bool is_lit) { | 857 void BrowserView::SetTranslateIconToggled(bool is_lit) { |
858 GetLocationBarView()->SetTranslateIconToggled(is_lit); | 858 // Translate icon is never active on Views. |
859 } | 859 } |
860 | 860 |
861 void BrowserView::OnActiveTabChanged(content::WebContents* old_contents, | 861 void BrowserView::OnActiveTabChanged(content::WebContents* old_contents, |
862 content::WebContents* new_contents, | 862 content::WebContents* new_contents, |
863 int index, | 863 int index, |
864 int reason) { | 864 int reason) { |
865 DCHECK(new_contents); | 865 DCHECK(new_contents); |
866 | 866 |
867 // If |contents_container_| already has the correct WebContents, we can save | 867 // If |contents_container_| already has the correct WebContents, we can save |
868 // some work. This also prevents extra events from being reported by the | 868 // some work. This also prevents extra events from being reported by the |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 } | 1273 } |
1274 | 1274 |
1275 void BrowserView::ShowBookmarkAppBubble( | 1275 void BrowserView::ShowBookmarkAppBubble( |
1276 const WebApplicationInfo& web_app_info, | 1276 const WebApplicationInfo& web_app_info, |
1277 const ShowBookmarkAppBubbleCallback& callback) { | 1277 const ShowBookmarkAppBubbleCallback& callback) { |
1278 BookmarkAppBubbleView::ShowBubble(GetToolbarView(), web_app_info, callback); | 1278 BookmarkAppBubbleView::ShowBubble(GetToolbarView(), web_app_info, callback); |
1279 } | 1279 } |
1280 | 1280 |
1281 autofill::SaveCardBubbleView* BrowserView::ShowSaveCreditCardBubble( | 1281 autofill::SaveCardBubbleView* BrowserView::ShowSaveCreditCardBubble( |
1282 content::WebContents* web_contents, | 1282 content::WebContents* web_contents, |
1283 autofill::SaveCardBubbleController* controller) { | 1283 autofill::SaveCardBubbleController* controller, |
1284 autofill::SaveCardBubbleView* view = new autofill::SaveCardBubbleViews( | 1284 bool is_user_gesture) { |
| 1285 autofill::SaveCardBubbleViews* view = new autofill::SaveCardBubbleViews( |
1285 GetToolbarView()->GetSaveCreditCardBubbleAnchor(), web_contents, | 1286 GetToolbarView()->GetSaveCreditCardBubbleAnchor(), web_contents, |
1286 controller); | 1287 controller); |
1287 view->Show(); | 1288 view->Show(is_user_gesture); |
1288 return view; | 1289 return view; |
1289 } | 1290 } |
1290 | 1291 |
1291 void BrowserView::ShowTranslateBubble( | 1292 void BrowserView::ShowTranslateBubble( |
1292 content::WebContents* web_contents, | 1293 content::WebContents* web_contents, |
1293 translate::TranslateStep step, | 1294 translate::TranslateStep step, |
1294 translate::TranslateErrors::Type error_type, | 1295 translate::TranslateErrors::Type error_type, |
1295 bool is_user_gesture) { | 1296 bool is_user_gesture) { |
1296 if (contents_web_view_->HasFocus() && | 1297 if (contents_web_view_->HasFocus() && |
1297 !GetLocationBarView()->IsMouseHovered()) { | 1298 !GetLocationBarView()->IsMouseHovered()) { |
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2642 return immersive_mode_controller()->IsEnabled(); | 2643 return immersive_mode_controller()->IsEnabled(); |
2643 } | 2644 } |
2644 | 2645 |
2645 views::Widget* BrowserView::GetBubbleAssociatedWidget() { | 2646 views::Widget* BrowserView::GetBubbleAssociatedWidget() { |
2646 return GetWidget(); | 2647 return GetWidget(); |
2647 } | 2648 } |
2648 | 2649 |
2649 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { | 2650 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { |
2650 return top_container_->GetBoundsInScreen(); | 2651 return top_container_->GetBoundsInScreen(); |
2651 } | 2652 } |
OLD | NEW |