| 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 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1617 return; | 1619 return; |
| 1618 } | 1620 } |
| 1619 | 1621 |
| 1620 // Make sure content-setting icon is turned off in case the page does | 1622 // Make sure content-setting icon is turned off in case the page does |
| 1621 // ungestured and gestured RPH calls. | 1623 // ungestured and gestured RPH calls. |
| 1622 if (window_) { | 1624 if (window_) { |
| 1623 tab_content_settings->ClearPendingProtocolHandler(); | 1625 tab_content_settings->ClearPendingProtocolHandler(); |
| 1624 window_->GetLocationBar()->UpdateContentSettingsIcons(); | 1626 window_->GetLocationBar()->UpdateContentSettingsIcons(); |
| 1625 } | 1627 } |
| 1626 | 1628 |
| 1627 RegisterProtocolHandlerInfoBarDelegate::Create( | 1629 PermissionBubbleManager* bubble_manager = |
| 1628 InfoBarService::FromWebContents(web_contents), registry, handler); | 1630 PermissionBubbleManager::FromWebContents(web_contents); |
| 1631 if (PermissionBubbleManager::Enabled() && bubble_manager) { |
| 1632 bubble_manager->AddRequest( |
| 1633 new RegisterProtocolHandlerPermissionRequest(registry, handler)); |
| 1634 } else { |
| 1635 RegisterProtocolHandlerInfoBarDelegate::Create( |
| 1636 InfoBarService::FromWebContents(web_contents), registry, handler); |
| 1637 } |
| 1629 } | 1638 } |
| 1630 | 1639 |
| 1631 void Browser::UpdatePreferredSize(WebContents* source, | 1640 void Browser::UpdatePreferredSize(WebContents* source, |
| 1632 const gfx::Size& pref_size) { | 1641 const gfx::Size& pref_size) { |
| 1633 window_->UpdatePreferredSize(source, pref_size); | 1642 window_->UpdatePreferredSize(source, pref_size); |
| 1634 } | 1643 } |
| 1635 | 1644 |
| 1636 void Browser::ResizeDueToAutoResize(WebContents* source, | 1645 void Browser::ResizeDueToAutoResize(WebContents* source, |
| 1637 const gfx::Size& new_size) { | 1646 const gfx::Size& new_size) { |
| 1638 window_->ResizeDueToAutoResize(source, new_size); | 1647 window_->ResizeDueToAutoResize(source, new_size); |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2303 if (contents && !allow_js_access) { | 2312 if (contents && !allow_js_access) { |
| 2304 contents->web_contents()->GetController().LoadURL( | 2313 contents->web_contents()->GetController().LoadURL( |
| 2305 target_url, | 2314 target_url, |
| 2306 content::Referrer(), | 2315 content::Referrer(), |
| 2307 content::PAGE_TRANSITION_LINK, | 2316 content::PAGE_TRANSITION_LINK, |
| 2308 std::string()); // No extra headers. | 2317 std::string()); // No extra headers. |
| 2309 } | 2318 } |
| 2310 | 2319 |
| 2311 return contents != NULL; | 2320 return contents != NULL; |
| 2312 } | 2321 } |
| OLD | NEW |