| 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 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" | 139 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" |
| 140 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 140 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
| 141 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 141 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 142 #include "chrome/browser/ui/tabs/tab_utils.h" | 142 #include "chrome/browser/ui/tabs/tab_utils.h" |
| 143 #include "chrome/browser/ui/unload_controller.h" | 143 #include "chrome/browser/ui/unload_controller.h" |
| 144 #include "chrome/browser/ui/validation_message_bubble.h" | 144 #include "chrome/browser/ui/validation_message_bubble.h" |
| 145 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 145 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 146 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 146 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 147 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 147 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
| 148 #include "chrome/browser/upgrade_detector.h" | 148 #include "chrome/browser/upgrade_detector.h" |
| 149 #include "chrome/browser/vr/vr_tab_helper.h" |
| 149 #include "chrome/common/chrome_constants.h" | 150 #include "chrome/common/chrome_constants.h" |
| 150 #include "chrome/common/chrome_switches.h" | 151 #include "chrome/common/chrome_switches.h" |
| 151 #include "chrome/common/custom_handlers/protocol_handler.h" | 152 #include "chrome/common/custom_handlers/protocol_handler.h" |
| 152 #include "chrome/common/pref_names.h" | 153 #include "chrome/common/pref_names.h" |
| 153 #include "chrome/common/profiling.h" | 154 #include "chrome/common/profiling.h" |
| 154 #include "chrome/common/ssl_insecure_content.h" | 155 #include "chrome/common/ssl_insecure_content.h" |
| 155 #include "chrome/common/url_constants.h" | 156 #include "chrome/common/url_constants.h" |
| 156 #include "chrome/grit/chromium_strings.h" | 157 #include "chrome/grit/chromium_strings.h" |
| 157 #include "components/bookmarks/browser/bookmark_model.h" | 158 #include "components/bookmarks/browser/bookmark_model.h" |
| 158 #include "components/bookmarks/browser/bookmark_utils.h" | 159 #include "components/bookmarks/browser/bookmark_utils.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 187 #include "content/public/browser/render_widget_host.h" | 188 #include "content/public/browser/render_widget_host.h" |
| 188 #include "content/public/browser/render_widget_host_view.h" | 189 #include "content/public/browser/render_widget_host_view.h" |
| 189 #include "content/public/browser/site_instance.h" | 190 #include "content/public/browser/site_instance.h" |
| 190 #include "content/public/browser/ssl_status.h" | 191 #include "content/public/browser/ssl_status.h" |
| 191 #include "content/public/browser/web_contents.h" | 192 #include "content/public/browser/web_contents.h" |
| 192 #include "content/public/common/content_constants.h" | 193 #include "content/public/common/content_constants.h" |
| 193 #include "content/public/common/content_switches.h" | 194 #include "content/public/common/content_switches.h" |
| 194 #include "content/public/common/page_zoom.h" | 195 #include "content/public/common/page_zoom.h" |
| 195 #include "content/public/common/renderer_preferences.h" | 196 #include "content/public/common/renderer_preferences.h" |
| 196 #include "content/public/common/webplugininfo.h" | 197 #include "content/public/common/webplugininfo.h" |
| 198 #include "device/vr/features/features.h" |
| 197 #include "extensions/browser/extension_prefs.h" | 199 #include "extensions/browser/extension_prefs.h" |
| 198 #include "extensions/browser/extension_registry.h" | 200 #include "extensions/browser/extension_registry.h" |
| 199 #include "extensions/browser/extension_system.h" | 201 #include "extensions/browser/extension_system.h" |
| 200 #include "extensions/common/constants.h" | 202 #include "extensions/common/constants.h" |
| 201 #include "extensions/common/extension.h" | 203 #include "extensions/common/extension.h" |
| 202 #include "extensions/common/manifest_handlers/background_info.h" | 204 #include "extensions/common/manifest_handlers/background_info.h" |
| 203 #include "extensions/features/features.h" | 205 #include "extensions/features/features.h" |
| 204 #include "net/base/filename_util.h" | 206 #include "net/base/filename_util.h" |
| 205 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 207 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 206 #include "net/cookies/cookie_monster.h" | 208 #include "net/cookies/cookie_monster.h" |
| (...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1780 } | 1782 } |
| 1781 | 1783 |
| 1782 void Browser::RegisterProtocolHandler(WebContents* web_contents, | 1784 void Browser::RegisterProtocolHandler(WebContents* web_contents, |
| 1783 const std::string& protocol, | 1785 const std::string& protocol, |
| 1784 const GURL& url, | 1786 const GURL& url, |
| 1785 bool user_gesture) { | 1787 bool user_gesture) { |
| 1786 content::BrowserContext* context = web_contents->GetBrowserContext(); | 1788 content::BrowserContext* context = web_contents->GetBrowserContext(); |
| 1787 if (context->IsOffTheRecord()) | 1789 if (context->IsOffTheRecord()) |
| 1788 return; | 1790 return; |
| 1789 | 1791 |
| 1792 if (vr::VrTabHelper::IsInVr(web_contents)) |
| 1793 return; |
| 1794 |
| 1790 ProtocolHandler handler = | 1795 ProtocolHandler handler = |
| 1791 ProtocolHandler::CreateProtocolHandler(protocol, url); | 1796 ProtocolHandler::CreateProtocolHandler(protocol, url); |
| 1792 | 1797 |
| 1793 ProtocolHandlerRegistry* registry = | 1798 ProtocolHandlerRegistry* registry = |
| 1794 ProtocolHandlerRegistryFactory::GetForBrowserContext(context); | 1799 ProtocolHandlerRegistryFactory::GetForBrowserContext(context); |
| 1795 if (registry->SilentlyHandleRegisterHandlerRequest(handler)) | 1800 if (registry->SilentlyHandleRegisterHandlerRequest(handler)) |
| 1796 return; | 1801 return; |
| 1797 | 1802 |
| 1798 TabSpecificContentSettings* tab_content_settings = | 1803 TabSpecificContentSettings* tab_content_settings = |
| 1799 TabSpecificContentSettings::FromWebContents(web_contents); | 1804 TabSpecificContentSettings::FromWebContents(web_contents); |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2618 // new window later, thus we need to navigate the window now. | 2623 // new window later, thus we need to navigate the window now. |
| 2619 if (contents) { | 2624 if (contents) { |
| 2620 contents->web_contents()->GetController().LoadURL( | 2625 contents->web_contents()->GetController().LoadURL( |
| 2621 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, | 2626 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, |
| 2622 std::string()); // No extra headers. | 2627 std::string()); // No extra headers. |
| 2623 } | 2628 } |
| 2624 } | 2629 } |
| 2625 | 2630 |
| 2626 return contents != NULL; | 2631 return contents != NULL; |
| 2627 } | 2632 } |
| OLD | NEW |