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 24 matching lines...) Expand all Loading... |
35 #include "chrome/browser/profiles/profile_window.h" | 35 #include "chrome/browser/profiles/profile_window.h" |
36 #include "chrome/browser/profiles/profiles_state.h" | 36 #include "chrome/browser/profiles/profiles_state.h" |
37 #include "chrome/browser/search/search.h" | 37 #include "chrome/browser/search/search.h" |
38 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 38 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
39 #include "chrome/browser/signin/chrome_signin_helper.h" | 39 #include "chrome/browser/signin/chrome_signin_helper.h" |
40 #include "chrome/browser/themes/theme_properties.h" | 40 #include "chrome/browser/themes/theme_properties.h" |
41 #include "chrome/browser/themes/theme_service_factory.h" | 41 #include "chrome/browser/themes/theme_service_factory.h" |
42 #include "chrome/browser/translate/chrome_translate_client.h" | 42 #include "chrome/browser/translate/chrome_translate_client.h" |
43 #include "chrome/browser/ui/ash/ash_util.h" | 43 #include "chrome/browser/ui/ash/ash_util.h" |
44 #include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h" | 44 #include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h" |
45 #include "chrome/browser/ui/bookmarks/bookmark_bubble_delegate.h" | |
46 #include "chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.h" | 45 #include "chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.h" |
47 #include "chrome/browser/ui/browser.h" | 46 #include "chrome/browser/ui/browser.h" |
48 #include "chrome/browser/ui/browser_command_controller.h" | 47 #include "chrome/browser/ui/browser_command_controller.h" |
49 #include "chrome/browser/ui/browser_commands.h" | 48 #include "chrome/browser/ui/browser_commands.h" |
50 #include "chrome/browser/ui/browser_dialogs.h" | 49 #include "chrome/browser/ui/browser_dialogs.h" |
51 #include "chrome/browser/ui/browser_finder.h" | 50 #include "chrome/browser/ui/browser_finder.h" |
52 #include "chrome/browser/ui/browser_list.h" | 51 #include "chrome/browser/ui/browser_list.h" |
53 #include "chrome/browser/ui/browser_window_state.h" | 52 #include "chrome/browser/ui/browser_window_state.h" |
54 #include "chrome/browser/ui/search/search_delegate.h" | 53 #include "chrome/browser/ui/search/search_delegate.h" |
55 #include "chrome/browser/ui/search/search_model.h" | 54 #include "chrome/browser/ui/search/search_model.h" |
56 #include "chrome/browser/ui/search/search_ui.h" | 55 #include "chrome/browser/ui/search/search_ui.h" |
| 56 #include "chrome/browser/ui/sync/bubble_sync_promo_delegate.h" |
57 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 57 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
58 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 58 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
59 #include "chrome/browser/ui/view_ids.h" | 59 #include "chrome/browser/ui/view_ids.h" |
60 #include "chrome/browser/ui/views/accelerator_table.h" | 60 #include "chrome/browser/ui/views/accelerator_table.h" |
61 #include "chrome/browser/ui/views/accessibility/invert_bubble_view.h" | 61 #include "chrome/browser/ui/views/accessibility/invert_bubble_view.h" |
62 #include "chrome/browser/ui/views/autofill/save_card_bubble_views.h" | 62 #include "chrome/browser/ui/views/autofill/save_card_bubble_views.h" |
63 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 63 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
64 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" | 64 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" |
65 #include "chrome/browser/ui/views/browser_dialogs.h" | 65 #include "chrome/browser/ui/views/browser_dialogs.h" |
66 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" | 66 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" |
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1286 Profile* profile) { | 1286 Profile* profile) { |
1287 chrome::EditSearchEngine(GetWidget()->GetNativeWindow(), template_url, | 1287 chrome::EditSearchEngine(GetWidget()->GetNativeWindow(), template_url, |
1288 nullptr, profile); | 1288 nullptr, profile); |
1289 } | 1289 } |
1290 | 1290 |
1291 void BrowserView::ShowUpdateChromeDialog() { | 1291 void BrowserView::ShowUpdateChromeDialog() { |
1292 UpdateRecommendedMessageBox::Show(GetWidget()->GetNativeWindow()); | 1292 UpdateRecommendedMessageBox::Show(GetWidget()->GetNativeWindow()); |
1293 } | 1293 } |
1294 | 1294 |
1295 void BrowserView::ShowBookmarkBubble(const GURL& url, bool already_bookmarked) { | 1295 void BrowserView::ShowBookmarkBubble(const GURL& url, bool already_bookmarked) { |
1296 scoped_ptr<BookmarkBubbleDelegate> delegate; | 1296 scoped_ptr<BubbleSyncPromoDelegate> delegate; |
1297 delegate.reset(new BookmarkBubbleSignInDelegate(browser_.get())); | 1297 delegate.reset(new BookmarkBubbleSignInDelegate(browser_.get())); |
1298 | 1298 |
1299 BookmarkBubbleView::ShowBubble(GetToolbarView()->GetBookmarkBubbleAnchor(), | 1299 BookmarkBubbleView::ShowBubble(GetToolbarView()->GetBookmarkBubbleAnchor(), |
1300 gfx::Rect(), nullptr, bookmark_bar_view_.get(), | 1300 gfx::Rect(), nullptr, bookmark_bar_view_.get(), |
1301 delegate.Pass(), browser_->profile(), url, | 1301 delegate.Pass(), browser_->profile(), url, |
1302 already_bookmarked); | 1302 already_bookmarked); |
1303 } | 1303 } |
1304 | 1304 |
1305 void BrowserView::ShowBookmarkAppBubble( | 1305 void BrowserView::ShowBookmarkAppBubble( |
1306 const WebApplicationInfo& web_app_info, | 1306 const WebApplicationInfo& web_app_info, |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2670 return immersive_mode_controller()->IsEnabled(); | 2670 return immersive_mode_controller()->IsEnabled(); |
2671 } | 2671 } |
2672 | 2672 |
2673 views::Widget* BrowserView::GetBubbleAssociatedWidget() { | 2673 views::Widget* BrowserView::GetBubbleAssociatedWidget() { |
2674 return GetWidget(); | 2674 return GetWidget(); |
2675 } | 2675 } |
2676 | 2676 |
2677 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { | 2677 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { |
2678 return top_container_->GetBoundsInScreen(); | 2678 return top_container_->GetBoundsInScreen(); |
2679 } | 2679 } |
OLD | NEW |