Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Side by Side Diff: chrome/browser/ui/browser_tab_contents.cc

Issue 23847004: "Redirecting URLs to Packaged Apps" implementation: revised (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_tab_contents.h" 5 #include "chrome/browser/ui/browser_tab_contents.h"
6 6
7 #include "apps/url_redirector.h"
7 #include "base/command_line.h" 8 #include "base/command_line.h"
8 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
10 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" 11 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h"
11 #include "chrome/browser/extensions/tab_helper.h" 12 #include "chrome/browser/extensions/tab_helper.h"
12 #include "chrome/browser/external_protocol/external_protocol_observer.h" 13 #include "chrome/browser/external_protocol/external_protocol_observer.h"
13 #include "chrome/browser/favicon/favicon_tab_helper.h" 14 #include "chrome/browser/favicon/favicon_tab_helper.h"
14 #include "chrome/browser/history/history_tab_helper.h" 15 #include "chrome/browser/history/history_tab_helper.h"
15 #include "chrome/browser/infobars/infobar_service.h" 16 #include "chrome/browser/infobars/infobar_service.h"
16 #include "chrome/browser/managed_mode/managed_mode_navigation_observer.h" 17 #include "chrome/browser/managed_mode/managed_mode_navigation_observer.h"
(...skipping 29 matching lines...) Expand all
46 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" 47 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h"
47 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" 48 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h"
48 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" 49 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
49 #include "chrome/browser/ui/zoom/zoom_controller.h" 50 #include "chrome/browser/ui/zoom/zoom_controller.h"
50 #include "chrome/common/chrome_switches.h" 51 #include "chrome/common/chrome_switches.h"
51 #include "components/autofill/content/browser/autofill_driver_impl.h" 52 #include "components/autofill/content/browser/autofill_driver_impl.h"
52 #include "components/autofill/core/browser/autofill_manager.h" 53 #include "components/autofill/core/browser/autofill_manager.h"
53 #include "components/web_modal/web_contents_modal_dialog_manager.h" 54 #include "components/web_modal/web_contents_modal_dialog_manager.h"
54 #include "content/public/browser/web_contents.h" 55 #include "content/public/browser/web_contents.h"
55 #include "extensions/browser/view_type_utils.h" 56 #include "extensions/browser/view_type_utils.h"
57 #include "extensions/common/switches.h"
56 58
57 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) 59 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
58 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" 60 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h"
59 #endif 61 #endif
60 62
61 #if defined(ENABLE_PRINTING) 63 #if defined(ENABLE_PRINTING)
62 #if defined(ENABLE_FULL_PRINTING) 64 #if defined(ENABLE_FULL_PRINTING)
63 #include "chrome/browser/printing/print_preview_message_handler.h" 65 #include "chrome/browser/printing/print_preview_message_handler.h"
64 #include "chrome/browser/printing/print_view_manager.h" 66 #include "chrome/browser/printing/print_view_manager.h"
65 #else 67 #else
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 107
106 // Create all the tab helpers. 108 // Create all the tab helpers.
107 109
108 Profile* profile = 110 Profile* profile =
109 Profile::FromBrowserContext(web_contents->GetBrowserContext()); 111 Profile::FromBrowserContext(web_contents->GetBrowserContext());
110 112
111 // SessionTabHelper comes first because it sets up the tab ID, and other 113 // SessionTabHelper comes first because it sets up the tab ID, and other
112 // helpers may rely on that. 114 // helpers may rely on that.
113 SessionTabHelper::CreateForWebContents(web_contents); 115 SessionTabHelper::CreateForWebContents(web_contents);
114 116
117 // TODO(sergeygs): Remove the 'if' and update includes once url_handlers are
118 // moved out of experimental.
119 if (CommandLine::ForCurrentProcess()->HasSwitch(
120 extensions::switches::kEnableExperimentalExtensionApis)) {
121 apps::UrlRedirector::CreateForWebContents(web_contents);
benwells 2013/09/03 01:10:56 Won't this get called for incognito profiles and h
sergeygs 2013/09/03 06:15:24 Nice catch here, added an 'if'.
122 }
115 AlternateErrorPageTabObserver::CreateForWebContents(web_contents); 123 AlternateErrorPageTabObserver::CreateForWebContents(web_contents);
116 TabAutofillManagerDelegate::CreateForWebContents(web_contents); 124 TabAutofillManagerDelegate::CreateForWebContents(web_contents);
117 AutofillDriverImpl::CreateForWebContentsAndDelegate( 125 AutofillDriverImpl::CreateForWebContentsAndDelegate(
118 web_contents, 126 web_contents,
119 TabAutofillManagerDelegate::FromWebContents(web_contents), 127 TabAutofillManagerDelegate::FromWebContents(web_contents),
120 g_browser_process->GetApplicationLocale(), 128 g_browser_process->GetApplicationLocale(),
121 AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER); 129 AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER);
122 BlockedContentTabHelper::CreateForWebContents(web_contents); 130 BlockedContentTabHelper::CreateForWebContents(web_contents);
123 BookmarkTabHelper::CreateForWebContents(web_contents); 131 BookmarkTabHelper::CreateForWebContents(web_contents);
124 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents( 132 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents(
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 NULL)) { 197 NULL)) {
190 OneClickSigninHelper::CreateForWebContentsWithPasswordManager( 198 OneClickSigninHelper::CreateForWebContentsWithPasswordManager(
191 web_contents, PasswordManager::FromWebContents(web_contents)); 199 web_contents, PasswordManager::FromWebContents(web_contents));
192 } 200 }
193 #endif 201 #endif
194 202
195 #if defined(OS_WIN) 203 #if defined(OS_WIN)
196 MetroPinTabHelper::CreateForWebContents(web_contents); 204 MetroPinTabHelper::CreateForWebContents(web_contents);
197 #endif 205 #endif
198 } 206 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698