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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 #include "chrome/browser/ui/status_bubble.h" | 124 #include "chrome/browser/ui/status_bubble.h" |
125 #include "chrome/browser/ui/sync/browser_synced_window_delegate.h" | 125 #include "chrome/browser/ui/sync/browser_synced_window_delegate.h" |
126 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 126 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
127 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" | 127 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" |
128 #include "chrome/browser/ui/tabs/dock_info.h" | 128 #include "chrome/browser/ui/tabs/dock_info.h" |
129 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 129 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
130 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 130 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
131 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" | 131 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" |
132 #include "chrome/browser/ui/unload_controller.h" | 132 #include "chrome/browser/ui/unload_controller.h" |
133 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 133 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
134 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" | |
135 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 134 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
136 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 135 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
137 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 136 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
138 #include "chrome/browser/ui/zoom/zoom_controller.h" | 137 #include "chrome/browser/ui/zoom/zoom_controller.h" |
139 #include "chrome/browser/upgrade_detector.h" | 138 #include "chrome/browser/upgrade_detector.h" |
140 #include "chrome/browser/web_applications/web_app.h" | 139 #include "chrome/browser/web_applications/web_app.h" |
141 #include "chrome/common/chrome_constants.h" | 140 #include "chrome/common/chrome_constants.h" |
142 #include "chrome/common/chrome_notification_types.h" | 141 #include "chrome/common/chrome_notification_types.h" |
143 #include "chrome/common/chrome_switches.h" | 142 #include "chrome/common/chrome_switches.h" |
144 #include "chrome/common/custom_handlers/protocol_handler.h" | 143 #include "chrome/common/custom_handlers/protocol_handler.h" |
145 #include "chrome/common/extensions/background_info.h" | 144 #include "chrome/common/extensions/background_info.h" |
146 #include "chrome/common/extensions/extension.h" | 145 #include "chrome/common/extensions/extension.h" |
147 #include "chrome/common/extensions/extension_constants.h" | 146 #include "chrome/common/extensions/extension_constants.h" |
148 #include "chrome/common/pref_names.h" | 147 #include "chrome/common/pref_names.h" |
149 #include "chrome/common/profiling.h" | 148 #include "chrome/common/profiling.h" |
150 #include "chrome/common/search_types.h" | 149 #include "chrome/common/search_types.h" |
151 #include "chrome/common/startup_metric_utils.h" | 150 #include "chrome/common/startup_metric_utils.h" |
152 #include "chrome/common/url_constants.h" | 151 #include "chrome/common/url_constants.h" |
| 152 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
153 #include "content/public/browser/color_chooser.h" | 153 #include "content/public/browser/color_chooser.h" |
154 #include "content/public/browser/devtools_manager.h" | 154 #include "content/public/browser/devtools_manager.h" |
155 #include "content/public/browser/download_item.h" | 155 #include "content/public/browser/download_item.h" |
156 #include "content/public/browser/download_manager.h" | 156 #include "content/public/browser/download_manager.h" |
157 #include "content/public/browser/interstitial_page.h" | 157 #include "content/public/browser/interstitial_page.h" |
158 #include "content/public/browser/invalidate_type.h" | 158 #include "content/public/browser/invalidate_type.h" |
159 #include "content/public/browser/navigation_controller.h" | 159 #include "content/public/browser/navigation_controller.h" |
160 #include "content/public/browser/navigation_entry.h" | 160 #include "content/public/browser/navigation_entry.h" |
161 #include "content/public/browser/notification_details.h" | 161 #include "content/public/browser/notification_details.h" |
162 #include "content/public/browser/notification_service.h" | 162 #include "content/public/browser/notification_service.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 using content::NavigationController; | 211 using content::NavigationController; |
212 using content::NavigationEntry; | 212 using content::NavigationEntry; |
213 using content::OpenURLParams; | 213 using content::OpenURLParams; |
214 using content::PluginService; | 214 using content::PluginService; |
215 using content::Referrer; | 215 using content::Referrer; |
216 using content::SiteInstance; | 216 using content::SiteInstance; |
217 using content::UserMetricsAction; | 217 using content::UserMetricsAction; |
218 using content::WebContents; | 218 using content::WebContents; |
219 using extensions::Extension; | 219 using extensions::Extension; |
220 using ui::WebDialogDelegate; | 220 using ui::WebDialogDelegate; |
| 221 using web_modal::WebContentsModalDialogManager; |
221 | 222 |
222 /////////////////////////////////////////////////////////////////////////////// | 223 /////////////////////////////////////////////////////////////////////////////// |
223 | 224 |
224 namespace { | 225 namespace { |
225 | 226 |
226 // The URL to be loaded to display the "Report a broken page" form. | 227 // The URL to be loaded to display the "Report a broken page" form. |
227 const char kBrokenPageUrl[] = | 228 const char kBrokenPageUrl[] = |
228 "https://www.google.com/support/chrome/bin/request.py?contact_type=" | 229 "https://www.google.com/support/chrome/bin/request.py?contact_type=" |
229 "broken_website&format=inproduct&p.page_title=$1&p.page_url=$2"; | 230 "broken_website&format=inproduct&p.page_title=$1&p.page_url=$2"; |
230 | 231 |
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1630 | 1631 |
1631 /////////////////////////////////////////////////////////////////////////////// | 1632 /////////////////////////////////////////////////////////////////////////////// |
1632 // Browser, SearchEngineTabHelperDelegate implementation: | 1633 // Browser, SearchEngineTabHelperDelegate implementation: |
1633 | 1634 |
1634 void Browser::ConfirmAddSearchProvider(TemplateURL* template_url, | 1635 void Browser::ConfirmAddSearchProvider(TemplateURL* template_url, |
1635 Profile* profile) { | 1636 Profile* profile) { |
1636 window()->ConfirmAddSearchProvider(template_url, profile); | 1637 window()->ConfirmAddSearchProvider(template_url, profile); |
1637 } | 1638 } |
1638 | 1639 |
1639 /////////////////////////////////////////////////////////////////////////////// | 1640 /////////////////////////////////////////////////////////////////////////////// |
1640 // Browser, WebContentsModalDialogManagerDelegate implementation: | 1641 // Browser, web_modal::WebContentsModalDialogManagerDelegate implementation: |
1641 | 1642 |
1642 void Browser::SetWebContentsBlocked(content::WebContents* web_contents, | 1643 void Browser::SetWebContentsBlocked(content::WebContents* web_contents, |
1643 bool blocked) { | 1644 bool blocked) { |
| 1645 ChromeWebModalDialogManagerDelegate::SetWebContentsBlocked(web_contents, |
| 1646 blocked); |
1644 int index = tab_strip_model_->GetIndexOfWebContents(web_contents); | 1647 int index = tab_strip_model_->GetIndexOfWebContents(web_contents); |
1645 if (index == TabStripModel::kNoTab) { | 1648 if (index == TabStripModel::kNoTab) { |
1646 NOTREACHED(); | 1649 NOTREACHED(); |
1647 return; | 1650 return; |
1648 } | 1651 } |
1649 tab_strip_model_->SetTabBlocked(index, blocked); | 1652 tab_strip_model_->SetTabBlocked(index, blocked); |
1650 if (!blocked && tab_strip_model_->GetActiveWebContents() == web_contents) | 1653 if (!blocked && tab_strip_model_->GetActiveWebContents() == web_contents) |
1651 web_contents->GetView()->Focus(); | 1654 web_contents->GetView()->Focus(); |
1652 } | 1655 } |
1653 | 1656 |
1654 WebContentsModalDialogHost* Browser::GetWebContentsModalDialogHost() { | 1657 web_modal::WebContentsModalDialogHost* |
| 1658 Browser::GetWebContentsModalDialogHost() { |
1655 return window_->GetWebContentsModalDialogHost(); | 1659 return window_->GetWebContentsModalDialogHost(); |
1656 } | 1660 } |
1657 | 1661 |
1658 /////////////////////////////////////////////////////////////////////////////// | 1662 /////////////////////////////////////////////////////////////////////////////// |
1659 // Browser, BlockedContentTabHelperDelegate implementation: | 1663 // Browser, BlockedContentTabHelperDelegate implementation: |
1660 | 1664 |
1661 content::WebContents* Browser::GetConstrainingWebContents( | 1665 content::WebContents* Browser::GetConstrainingWebContents( |
1662 content::WebContents* source) { | 1666 content::WebContents* source) { |
1663 return source; | 1667 return source; |
1664 } | 1668 } |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2225 if (contents && !allow_js_access) { | 2229 if (contents && !allow_js_access) { |
2226 contents->web_contents()->GetController().LoadURL( | 2230 contents->web_contents()->GetController().LoadURL( |
2227 target_url, | 2231 target_url, |
2228 content::Referrer(), | 2232 content::Referrer(), |
2229 content::PAGE_TRANSITION_LINK, | 2233 content::PAGE_TRANSITION_LINK, |
2230 std::string()); // No extra headers. | 2234 std::string()); // No extra headers. |
2231 } | 2235 } |
2232 | 2236 |
2233 return contents != NULL; | 2237 return contents != NULL; |
2234 } | 2238 } |
OLD | NEW |