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 12 matching lines...) Expand all Loading... |
23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
24 #include "chrome/app/chrome_command_ids.h" | 24 #include "chrome/app/chrome_command_ids.h" |
25 #include "chrome/browser/app_mode/app_mode_utils.h" | 25 #include "chrome/browser/app_mode/app_mode_utils.h" |
26 #include "chrome/browser/bookmarks/bookmark_stats.h" | 26 #include "chrome/browser/bookmarks/bookmark_stats.h" |
27 #include "chrome/browser/browser_process.h" | 27 #include "chrome/browser/browser_process.h" |
28 #include "chrome/browser/chrome_notification_types.h" | 28 #include "chrome/browser/chrome_notification_types.h" |
29 #include "chrome/browser/extensions/extension_util.h" | 29 #include "chrome/browser/extensions/extension_util.h" |
30 #include "chrome/browser/extensions/tab_helper.h" | 30 #include "chrome/browser/extensions/tab_helper.h" |
31 #include "chrome/browser/infobars/infobar_service.h" | 31 #include "chrome/browser/infobars/infobar_service.h" |
32 #include "chrome/browser/native_window_notification_source.h" | 32 #include "chrome/browser/native_window_notification_source.h" |
| 33 #include "chrome/browser/payments/payment_request_impl.h" |
33 #include "chrome/browser/permissions/permission_request_manager.h" | 34 #include "chrome/browser/permissions/permission_request_manager.h" |
34 #include "chrome/browser/profiles/avatar_menu.h" | 35 #include "chrome/browser/profiles/avatar_menu.h" |
35 #include "chrome/browser/profiles/profile.h" | 36 #include "chrome/browser/profiles/profile.h" |
36 #include "chrome/browser/profiles/profile_attributes_entry.h" | 37 #include "chrome/browser/profiles/profile_attributes_entry.h" |
37 #include "chrome/browser/profiles/profile_attributes_storage.h" | 38 #include "chrome/browser/profiles/profile_attributes_storage.h" |
38 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 39 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
39 #include "chrome/browser/profiles/profile_manager.h" | 40 #include "chrome/browser/profiles/profile_manager.h" |
40 #include "chrome/browser/profiles/profile_window.h" | 41 #include "chrome/browser/profiles/profile_window.h" |
41 #include "chrome/browser/profiles/profiles_state.h" | 42 #include "chrome/browser/profiles/profiles_state.h" |
42 #include "chrome/browser/search/search.h" | 43 #include "chrome/browser/search/search.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 #include "chrome/browser/ui/views/frame/top_container_view.h" | 77 #include "chrome/browser/ui/views/frame/top_container_view.h" |
77 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" | 78 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" |
78 #include "chrome/browser/ui/views/ime/ime_warning_bubble_view.h" | 79 #include "chrome/browser/ui/views/ime/ime_warning_bubble_view.h" |
79 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" | 80 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" |
80 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 81 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
81 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 82 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
82 #include "chrome/browser/ui/views/location_bar/star_view.h" | 83 #include "chrome/browser/ui/views/location_bar/star_view.h" |
83 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" | 84 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" |
84 #include "chrome/browser/ui/views/new_back_shortcut_bubble.h" | 85 #include "chrome/browser/ui/views/new_back_shortcut_bubble.h" |
85 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 86 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
| 87 #include "chrome/browser/ui/views/payments/payment_request_dialog.h" |
86 #include "chrome/browser/ui/views/profiles/profile_indicator_icon.h" | 88 #include "chrome/browser/ui/views/profiles/profile_indicator_icon.h" |
87 #include "chrome/browser/ui/views/session_crashed_bubble_view.h" | 89 #include "chrome/browser/ui/views/session_crashed_bubble_view.h" |
88 #include "chrome/browser/ui/views/status_bubble_views.h" | 90 #include "chrome/browser/ui/views/status_bubble_views.h" |
89 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" | 91 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" |
90 #include "chrome/browser/ui/views/tabs/tab.h" | 92 #include "chrome/browser/ui/views/tabs/tab.h" |
91 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 93 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
92 #include "chrome/browser/ui/views/toolbar/app_menu_button.h" | 94 #include "chrome/browser/ui/views/toolbar/app_menu_button.h" |
93 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" | 95 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" |
94 #include "chrome/browser/ui/views/toolbar/reload_button.h" | 96 #include "chrome/browser/ui/views/toolbar/reload_button.h" |
95 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" | 97 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
96 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" | 98 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" |
97 #include "chrome/browser/ui/views/update_recommended_message_box.h" | 99 #include "chrome/browser/ui/views/update_recommended_message_box.h" |
98 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h
" | 100 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h
" |
99 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 101 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
100 #include "chrome/common/chrome_switches.h" | 102 #include "chrome/common/chrome_switches.h" |
101 #include "chrome/common/extensions/command.h" | 103 #include "chrome/common/extensions/command.h" |
102 #include "chrome/common/features.h" | 104 #include "chrome/common/features.h" |
103 #include "chrome/common/pref_names.h" | 105 #include "chrome/common/pref_names.h" |
104 #include "chrome/common/url_constants.h" | 106 #include "chrome/common/url_constants.h" |
105 #include "chrome/grit/chromium_strings.h" | 107 #include "chrome/grit/chromium_strings.h" |
106 #include "chrome/grit/generated_resources.h" | 108 #include "chrome/grit/generated_resources.h" |
107 #include "chrome/grit/locale_settings.h" | 109 #include "chrome/grit/locale_settings.h" |
108 #include "chrome/grit/theme_resources.h" | 110 #include "chrome/grit/theme_resources.h" |
109 #include "components/app_modal/app_modal_dialog.h" | 111 #include "components/app_modal/app_modal_dialog.h" |
110 #include "components/app_modal/app_modal_dialog_queue.h" | 112 #include "components/app_modal/app_modal_dialog_queue.h" |
111 #include "components/app_modal/native_app_modal_dialog.h" | 113 #include "components/app_modal/native_app_modal_dialog.h" |
| 114 #include "components/constrained_window/constrained_window_views.h" |
112 #include "components/omnibox/browser/omnibox_popup_model.h" | 115 #include "components/omnibox/browser/omnibox_popup_model.h" |
113 #include "components/omnibox/browser/omnibox_popup_view.h" | 116 #include "components/omnibox/browser/omnibox_popup_view.h" |
114 #include "components/omnibox/browser/omnibox_view.h" | 117 #include "components/omnibox/browser/omnibox_view.h" |
115 #include "components/prefs/pref_service.h" | 118 #include "components/prefs/pref_service.h" |
116 #include "components/sessions/core/tab_restore_service.h" | 119 #include "components/sessions/core/tab_restore_service.h" |
117 #include "components/signin/core/common/profile_management_switches.h" | 120 #include "components/signin/core/common/profile_management_switches.h" |
118 #include "components/translate/core/browser/language_state.h" | 121 #include "components/translate/core/browser/language_state.h" |
119 #include "content/public/browser/download_manager.h" | 122 #include "content/public/browser/download_manager.h" |
120 #include "content/public/browser/notification_service.h" | 123 #include "content/public/browser/notification_service.h" |
121 #include "content/public/browser/render_frame_host.h" | 124 #include "content/public/browser/render_frame_host.h" |
(...skipping 2359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2481 } | 2484 } |
2482 | 2485 |
2483 std::string BrowserView::GetWorkspace() const { | 2486 std::string BrowserView::GetWorkspace() const { |
2484 return frame_->GetWorkspace(); | 2487 return frame_->GetWorkspace(); |
2485 } | 2488 } |
2486 | 2489 |
2487 bool BrowserView::IsVisibleOnAllWorkspaces() const { | 2490 bool BrowserView::IsVisibleOnAllWorkspaces() const { |
2488 return frame_->IsVisibleOnAllWorkspaces(); | 2491 return frame_->IsVisibleOnAllWorkspaces(); |
2489 } | 2492 } |
2490 | 2493 |
| 2494 void BrowserView::ShowWebPaymentsDialog(payments::PaymentRequestImpl* impl) { |
| 2495 constrained_window::ShowWebModalDialogViews( |
| 2496 new payments::PaymentRequestDialog(impl), impl->web_contents()); |
| 2497 } |
| 2498 |
2491 bool BrowserView::DoCutCopyPasteForWebContents( | 2499 bool BrowserView::DoCutCopyPasteForWebContents( |
2492 WebContents* contents, | 2500 WebContents* contents, |
2493 void (WebContents::*method)()) { | 2501 void (WebContents::*method)()) { |
2494 // It's possible for a non-null WebContents to have a null RWHV if it's | 2502 // It's possible for a non-null WebContents to have a null RWHV if it's |
2495 // crashed or otherwise been killed. | 2503 // crashed or otherwise been killed. |
2496 content::RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView(); | 2504 content::RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView(); |
2497 if (!rwhv || !rwhv->HasFocus()) | 2505 if (!rwhv || !rwhv->HasFocus()) |
2498 return false; | 2506 return false; |
2499 // Calling |method| rather than using a fake key event is important since a | 2507 // Calling |method| rather than using a fake key event is important since a |
2500 // fake event might be consumed by the web content. | 2508 // fake event might be consumed by the web content. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2596 } | 2604 } |
2597 | 2605 |
2598 extensions::ActiveTabPermissionGranter* | 2606 extensions::ActiveTabPermissionGranter* |
2599 BrowserView::GetActiveTabPermissionGranter() { | 2607 BrowserView::GetActiveTabPermissionGranter() { |
2600 content::WebContents* web_contents = GetActiveWebContents(); | 2608 content::WebContents* web_contents = GetActiveWebContents(); |
2601 if (!web_contents) | 2609 if (!web_contents) |
2602 return nullptr; | 2610 return nullptr; |
2603 return extensions::TabHelper::FromWebContents(web_contents) | 2611 return extensions::TabHelper::FromWebContents(web_contents) |
2604 ->active_tab_permission_granter(); | 2612 ->active_tab_permission_granter(); |
2605 } | 2613 } |
OLD | NEW |