| 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 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/browser/profiles/avatar_menu.h" | 27 #include "chrome/browser/profiles/avatar_menu.h" |
| 28 #include "chrome/browser/profiles/profile.h" | 28 #include "chrome/browser/profiles/profile.h" |
| 29 #include "chrome/browser/profiles/profile_info_cache.h" | 29 #include "chrome/browser/profiles/profile_info_cache.h" |
| 30 #include "chrome/browser/profiles/profile_manager.h" | 30 #include "chrome/browser/profiles/profile_manager.h" |
| 31 #include "chrome/browser/search/search.h" | 31 #include "chrome/browser/search/search.h" |
| 32 #include "chrome/browser/sessions/tab_restore_service.h" | 32 #include "chrome/browser/sessions/tab_restore_service.h" |
| 33 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 33 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 34 #include "chrome/browser/speech/tts_controller.h" | 34 #include "chrome/browser/speech/tts_controller.h" |
| 35 #include "chrome/browser/themes/theme_properties.h" | 35 #include "chrome/browser/themes/theme_properties.h" |
| 36 #include "chrome/browser/themes/theme_service_factory.h" | 36 #include "chrome/browser/themes/theme_service_factory.h" |
| 37 #include "chrome/browser/translate/translate_tab_helper.h" |
| 37 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" | 38 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" |
| 38 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 39 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
| 39 #include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h" | 40 #include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h" |
| 40 #include "chrome/browser/ui/bookmarks/bookmark_bubble_delegate.h" | 41 #include "chrome/browser/ui/bookmarks/bookmark_bubble_delegate.h" |
| 41 #include "chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.h" | 42 #include "chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.h" |
| 42 #include "chrome/browser/ui/browser.h" | 43 #include "chrome/browser/ui/browser.h" |
| 43 #include "chrome/browser/ui/browser_command_controller.h" | 44 #include "chrome/browser/ui/browser_command_controller.h" |
| 44 #include "chrome/browser/ui/browser_commands.h" | 45 #include "chrome/browser/ui/browser_commands.h" |
| 45 #include "chrome/browser/ui/browser_dialogs.h" | 46 #include "chrome/browser/ui/browser_dialogs.h" |
| 46 #include "chrome/browser/ui/browser_finder.h" | 47 #include "chrome/browser/ui/browser_finder.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 75 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 76 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 76 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 77 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
| 77 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 78 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
| 78 #include "chrome/browser/ui/views/omnibox/omnibox_views.h" | 79 #include "chrome/browser/ui/views/omnibox/omnibox_views.h" |
| 79 #include "chrome/browser/ui/views/password_generation_bubble_view.h" | 80 #include "chrome/browser/ui/views/password_generation_bubble_view.h" |
| 80 #include "chrome/browser/ui/views/status_bubble_views.h" | 81 #include "chrome/browser/ui/views/status_bubble_views.h" |
| 81 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" | 82 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" |
| 82 #include "chrome/browser/ui/views/tabs/tab.h" | 83 #include "chrome/browser/ui/views/tabs/tab.h" |
| 83 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 84 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 84 #include "chrome/browser/ui/views/toolbar_view.h" | 85 #include "chrome/browser/ui/views/toolbar_view.h" |
| 86 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" |
| 85 #include "chrome/browser/ui/views/update_recommended_message_box.h" | 87 #include "chrome/browser/ui/views/update_recommended_message_box.h" |
| 86 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h
" | 88 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h
" |
| 87 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 89 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
| 88 #include "chrome/common/chrome_switches.h" | 90 #include "chrome/common/chrome_switches.h" |
| 89 #include "chrome/common/pref_names.h" | 91 #include "chrome/common/pref_names.h" |
| 90 #include "chrome/common/url_constants.h" | 92 #include "chrome/common/url_constants.h" |
| 91 #include "content/public/browser/download_manager.h" | 93 #include "content/public/browser/download_manager.h" |
| 92 #include "content/public/browser/native_web_keyboard_event.h" | 94 #include "content/public/browser/native_web_keyboard_event.h" |
| 93 #include "content/public/browser/notification_service.h" | 95 #include "content/public/browser/notification_service.h" |
| 94 #include "content/public/browser/render_view_host.h" | 96 #include "content/public/browser/render_view_host.h" |
| (...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 delegate.Pass(), | 1173 delegate.Pass(), |
| 1172 browser_->profile(), | 1174 browser_->profile(), |
| 1173 url, | 1175 url, |
| 1174 !already_bookmarked); | 1176 !already_bookmarked); |
| 1175 } | 1177 } |
| 1176 | 1178 |
| 1177 void BrowserView::ShowBookmarkPrompt() { | 1179 void BrowserView::ShowBookmarkPrompt() { |
| 1178 GetLocationBarView()->ShowBookmarkPrompt(); | 1180 GetLocationBarView()->ShowBookmarkPrompt(); |
| 1179 } | 1181 } |
| 1180 | 1182 |
| 1183 void BrowserView::ShowTranslateBubble( |
| 1184 content::WebContents* web_contents, |
| 1185 TranslateBubbleModel::ViewState view_state) { |
| 1186 TranslateTabHelper* translate_tab_helper = |
| 1187 TranslateTabHelper::FromWebContents(web_contents); |
| 1188 LanguageState& language_state = translate_tab_helper->language_state(); |
| 1189 language_state.SetTranslateEnabled(true); |
| 1190 |
| 1191 TranslateBubbleView::ShowBubble(GetToolbarView()->GetTranslateBubbleAnchor(), |
| 1192 web_contents, view_state, browser_.get()); |
| 1193 } |
| 1194 |
| 1181 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 1195 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 1182 void BrowserView::ShowOneClickSigninBubble( | 1196 void BrowserView::ShowOneClickSigninBubble( |
| 1183 OneClickSigninBubbleType type, | 1197 OneClickSigninBubbleType type, |
| 1184 const string16& email, | 1198 const string16& email, |
| 1185 const string16& error_message, | 1199 const string16& error_message, |
| 1186 const StartSyncCallback& start_sync_callback) { | 1200 const StartSyncCallback& start_sync_callback) { |
| 1187 scoped_ptr<OneClickSigninBubbleDelegate> delegate; | 1201 scoped_ptr<OneClickSigninBubbleDelegate> delegate; |
| 1188 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser())); | 1202 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser())); |
| 1189 | 1203 |
| 1190 views::View* anchor_view; | 1204 views::View* anchor_view; |
| (...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2692 // The +1 in the next line creates a 1-px gap between icon and arrow tip. | 2706 // The +1 in the next line creates a 1-px gap between icon and arrow tip. |
| 2693 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - | 2707 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - |
| 2694 LocationBarView::kIconInternalPadding + 1); | 2708 LocationBarView::kIconInternalPadding + 1); |
| 2695 ConvertPointToTarget(location_icon_view, this, &icon_bottom); | 2709 ConvertPointToTarget(location_icon_view, this, &icon_bottom); |
| 2696 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2710 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2697 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2711 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2698 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2712 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2699 } | 2713 } |
| 2700 return top_arrow_height; | 2714 return top_arrow_height; |
| 2701 } | 2715 } |
| OLD | NEW |