| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 #include "chrome/browser/ui/views/frame/top_container_view.h" | 74 #include "chrome/browser/ui/views/frame/top_container_view.h" |
| 75 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" | 75 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" |
| 76 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" | 76 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" |
| 77 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 77 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 78 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 78 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
| 79 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" | 79 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" |
| 80 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 80 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
| 81 #include "chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h" | 81 #include "chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h" |
| 82 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" | 82 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" |
| 83 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 83 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
| 84 #include "chrome/browser/ui/views/profiles/profile_reset_bubble_view.h" |
| 85 #include "chrome/browser/ui/views/session_crashed_bubble_view.h" |
| 84 #include "chrome/browser/ui/views/settings_api_bubble_helper_views.h" | 86 #include "chrome/browser/ui/views/settings_api_bubble_helper_views.h" |
| 85 #include "chrome/browser/ui/views/status_bubble_views.h" | 87 #include "chrome/browser/ui/views/status_bubble_views.h" |
| 86 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" | 88 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" |
| 87 #include "chrome/browser/ui/views/tabs/tab.h" | 89 #include "chrome/browser/ui/views/tabs/tab.h" |
| 88 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 90 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 89 #include "chrome/browser/ui/views/toolbar/reload_button.h" | 91 #include "chrome/browser/ui/views/toolbar/reload_button.h" |
| 90 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" | 92 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
| 91 #include "chrome/browser/ui/views/toolbar/wrench_toolbar_button.h" | 93 #include "chrome/browser/ui/views/toolbar/wrench_toolbar_button.h" |
| 92 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" | 94 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" |
| 93 #include "chrome/browser/ui/views/update_recommended_message_box.h" | 95 #include "chrome/browser/ui/views/update_recommended_message_box.h" |
| (...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 language_state.SetTranslateEnabled(true); | 1260 language_state.SetTranslateEnabled(true); |
| 1259 | 1261 |
| 1260 if (IsMinimized()) | 1262 if (IsMinimized()) |
| 1261 return; | 1263 return; |
| 1262 | 1264 |
| 1263 TranslateBubbleView::ShowBubble( | 1265 TranslateBubbleView::ShowBubble( |
| 1264 GetToolbarView()->GetTranslateBubbleAnchor(), web_contents, step, | 1266 GetToolbarView()->GetTranslateBubbleAnchor(), web_contents, step, |
| 1265 error_type, is_user_gesture); | 1267 error_type, is_user_gesture); |
| 1266 } | 1268 } |
| 1267 | 1269 |
| 1270 bool BrowserView::ShowSessionCrashedBubble() { |
| 1271 return SessionCrashedBubbleView::Show(browser_.get()); |
| 1272 } |
| 1273 |
| 1274 bool BrowserView::IsProfileResetBubbleSupported() const { |
| 1275 return true; |
| 1276 } |
| 1277 |
| 1278 GlobalErrorBubbleViewBase* BrowserView::ShowProfileResetBubble( |
| 1279 const base::WeakPtr<ProfileResetGlobalError>& global_error) { |
| 1280 return ProfileResetBubbleView::ShowBubble(global_error, browser_.get()); |
| 1281 } |
| 1282 |
| 1268 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 1283 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 1269 void BrowserView::ShowOneClickSigninBubble( | 1284 void BrowserView::ShowOneClickSigninBubble( |
| 1270 OneClickSigninBubbleType type, | 1285 OneClickSigninBubbleType type, |
| 1271 const base::string16& email, | 1286 const base::string16& email, |
| 1272 const base::string16& error_message, | 1287 const base::string16& error_message, |
| 1273 const StartSyncCallback& start_sync_callback) { | 1288 const StartSyncCallback& start_sync_callback) { |
| 1274 scoped_ptr<OneClickSigninBubbleDelegate> delegate; | 1289 scoped_ptr<OneClickSigninBubbleDelegate> delegate; |
| 1275 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser())); | 1290 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser())); |
| 1276 | 1291 |
| 1277 views::View* anchor_view; | 1292 views::View* anchor_view; |
| (...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2568 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2583 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2569 gfx::Point icon_bottom( | 2584 gfx::Point icon_bottom( |
| 2570 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2585 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2571 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2586 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2572 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); | 2587 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); |
| 2573 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2588 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2574 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2589 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2575 } | 2590 } |
| 2576 return top_arrow_height; | 2591 return top_arrow_height; |
| 2577 } | 2592 } |
| OLD | NEW |