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 26 matching lines...) Expand all Loading... | |
37 #include "chrome/browser/browser_process.h" | 37 #include "chrome/browser/browser_process.h" |
38 #include "chrome/browser/browser_shutdown.h" | 38 #include "chrome/browser/browser_shutdown.h" |
39 #include "chrome/browser/character_encoding.h" | 39 #include "chrome/browser/character_encoding.h" |
40 #include "chrome/browser/chrome_notification_types.h" | 40 #include "chrome/browser/chrome_notification_types.h" |
41 #include "chrome/browser/chrome_page_zoom.h" | 41 #include "chrome/browser/chrome_page_zoom.h" |
42 #include "chrome/browser/content_settings/host_content_settings_map.h" | 42 #include "chrome/browser/content_settings/host_content_settings_map.h" |
43 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 43 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
44 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 44 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
45 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 45 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
46 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg ate.h" | 46 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg ate.h" |
47 #include "chrome/browser/custom_handlers/register_protocol_handler_permission_re quest.h" | |
47 #include "chrome/browser/defaults.h" | 48 #include "chrome/browser/defaults.h" |
48 #include "chrome/browser/devtools/devtools_toggle_action.h" | 49 #include "chrome/browser/devtools/devtools_toggle_action.h" |
49 #include "chrome/browser/devtools/devtools_window.h" | 50 #include "chrome/browser/devtools/devtools_window.h" |
50 #include "chrome/browser/download/download_item_model.h" | 51 #include "chrome/browser/download/download_item_model.h" |
51 #include "chrome/browser/download/download_service.h" | 52 #include "chrome/browser/download/download_service.h" |
52 #include "chrome/browser/download/download_service_factory.h" | 53 #include "chrome/browser/download/download_service_factory.h" |
53 #include "chrome/browser/download/download_shelf.h" | 54 #include "chrome/browser/download/download_shelf.h" |
54 #include "chrome/browser/extensions/browser_extension_window_controller.h" | 55 #include "chrome/browser/extensions/browser_extension_window_controller.h" |
55 #include "chrome/browser/extensions/extension_service.h" | 56 #include "chrome/browser/extensions/extension_service.h" |
56 #include "chrome/browser/extensions/tab_helper.h" | 57 #include "chrome/browser/extensions/tab_helper.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 128 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
128 #include "chrome/browser/ui/tab_helpers.h" | 129 #include "chrome/browser/ui/tab_helpers.h" |
129 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" | 130 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" |
130 #include "chrome/browser/ui/tabs/dock_info.h" | 131 #include "chrome/browser/ui/tabs/dock_info.h" |
131 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 132 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
132 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 133 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
133 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" | 134 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" |
134 #include "chrome/browser/ui/unload_controller.h" | 135 #include "chrome/browser/ui/unload_controller.h" |
135 #include "chrome/browser/ui/validation_message_bubble.h" | 136 #include "chrome/browser/ui/validation_message_bubble.h" |
136 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 137 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
138 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | |
137 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 139 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
138 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 140 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
139 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 141 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
140 #include "chrome/browser/ui/zoom/zoom_controller.h" | 142 #include "chrome/browser/ui/zoom/zoom_controller.h" |
141 #include "chrome/browser/upgrade_detector.h" | 143 #include "chrome/browser/upgrade_detector.h" |
142 #include "chrome/browser/web_applications/web_app.h" | 144 #include "chrome/browser/web_applications/web_app.h" |
143 #include "chrome/common/chrome_constants.h" | 145 #include "chrome/common/chrome_constants.h" |
144 #include "chrome/common/chrome_switches.h" | 146 #include "chrome/common/chrome_switches.h" |
145 #include "chrome/common/custom_handlers/protocol_handler.h" | 147 #include "chrome/common/custom_handlers/protocol_handler.h" |
146 #include "chrome/common/net/url_fixer_upper.h" | 148 #include "chrome/common/net/url_fixer_upper.h" |
(...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1615 return; | 1617 return; |
1616 } | 1618 } |
1617 | 1619 |
1618 // Make sure content-setting icon is turned off in case the page does | 1620 // Make sure content-setting icon is turned off in case the page does |
1619 // ungestured and gestured RPH calls. | 1621 // ungestured and gestured RPH calls. |
1620 if (window_) { | 1622 if (window_) { |
1621 tab_content_settings->ClearPendingProtocolHandler(); | 1623 tab_content_settings->ClearPendingProtocolHandler(); |
1622 window_->GetLocationBar()->UpdateContentSettingsIcons(); | 1624 window_->GetLocationBar()->UpdateContentSettingsIcons(); |
1623 } | 1625 } |
1624 | 1626 |
1627 if (PermissionBubbleManager::Enabled() && | |
1628 PermissionBubbleManager::FromWebContents(web_contents)) { | |
1629 PermissionBubbleManager* bubble_manager = | |
1630 PermissionBubbleManager::FromWebContents(web_contents); | |
Lei Zhang
2014/02/13 21:48:30
Reuse the result from line 1628?
Peter Kasting
2014/02/13 21:50:36
SGTM
Greg Billock
2014/02/13 22:49:03
Done.
| |
1631 bubble_manager->AddRequest(new RegisterProtocolHandlerPermissionRequest( | |
Peter Kasting
2014/02/13 21:50:36
Tiny nit: I would probably break before "new" inst
Greg Billock
2014/02/13 22:49:03
Done.
| |
1632 registry, handler)); | |
1633 return; | |
Peter Kasting
2014/02/13 21:50:36
Nit: Instead of this return I'd do "else" after th
Greg Billock
2014/02/13 22:49:03
Done.
| |
1634 } | |
1635 | |
1625 RegisterProtocolHandlerInfoBarDelegate::Create( | 1636 RegisterProtocolHandlerInfoBarDelegate::Create( |
1626 InfoBarService::FromWebContents(web_contents), registry, handler); | 1637 InfoBarService::FromWebContents(web_contents), registry, handler); |
1627 } | 1638 } |
1628 | 1639 |
1629 void Browser::UpdatePreferredSize(WebContents* source, | 1640 void Browser::UpdatePreferredSize(WebContents* source, |
1630 const gfx::Size& pref_size) { | 1641 const gfx::Size& pref_size) { |
1631 window_->UpdatePreferredSize(source, pref_size); | 1642 window_->UpdatePreferredSize(source, pref_size); |
1632 } | 1643 } |
1633 | 1644 |
1634 void Browser::ResizeDueToAutoResize(WebContents* source, | 1645 void Browser::ResizeDueToAutoResize(WebContents* source, |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2292 if (contents && !allow_js_access) { | 2303 if (contents && !allow_js_access) { |
2293 contents->web_contents()->GetController().LoadURL( | 2304 contents->web_contents()->GetController().LoadURL( |
2294 target_url, | 2305 target_url, |
2295 content::Referrer(), | 2306 content::Referrer(), |
2296 content::PAGE_TRANSITION_LINK, | 2307 content::PAGE_TRANSITION_LINK, |
2297 std::string()); // No extra headers. | 2308 std::string()); // No extra headers. |
2298 } | 2309 } |
2299 | 2310 |
2300 return contents != NULL; | 2311 return contents != NULL; |
2301 } | 2312 } |
OLD | NEW |