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

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

Issue 383903003: ifdef various extensions code to be used only when extensions are enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build Created 6 years, 5 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
« no previous file with comments | « chrome/browser/prefs/chrome_pref_service_factory.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/tab_helpers.h" 5 #include "chrome/browser/ui/tab_helpers.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
10 #include "chrome/browser/favicon/favicon_tab_helper.h" 10 #include "chrome/browser/favicon/favicon_tab_helper.h"
(...skipping 12 matching lines...) Expand all
23 #include "chrome/browser/ui/navigation_correction_tab_observer.h" 23 #include "chrome/browser/ui/navigation_correction_tab_observer.h"
24 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" 24 #include "chrome/browser/ui/prefs/prefs_tab_helper.h"
25 #include "chrome/browser/ui/search/search_tab_helper.h" 25 #include "chrome/browser/ui/search/search_tab_helper.h"
26 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" 26 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
27 #include "chrome/common/chrome_switches.h" 27 #include "chrome/common/chrome_switches.h"
28 #include "components/autofill/content/browser/content_autofill_driver.h" 28 #include "components/autofill/content/browser/content_autofill_driver.h"
29 #include "components/autofill/core/browser/autofill_manager.h" 29 #include "components/autofill/core/browser/autofill_manager.h"
30 #include "components/dom_distiller/content/web_contents_main_frame_observer.h" 30 #include "components/dom_distiller/content/web_contents_main_frame_observer.h"
31 #include "components/password_manager/core/browser/password_manager.h" 31 #include "components/password_manager/core/browser/password_manager.h"
32 #include "content/public/browser/web_contents.h" 32 #include "content/public/browser/web_contents.h"
33 #include "extensions/browser/view_type_utils.h"
34 33
35 #if defined(OS_ANDROID) 34 #if defined(OS_ANDROID)
36 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" 35 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h"
37 #include "chrome/browser/ui/android/context_menu_helper.h" 36 #include "chrome/browser/ui/android/context_menu_helper.h"
38 #include "chrome/browser/ui/android/window_android_helper.h" 37 #include "chrome/browser/ui/android/window_android_helper.h"
39 #else 38 #else
40 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h"
41 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
42 #include "chrome/browser/net/predictor_tab_helper.h" 39 #include "chrome/browser/net/predictor_tab_helper.h"
43 #include "chrome/browser/plugins/plugin_observer.h" 40 #include "chrome/browser/plugins/plugin_observer.h"
44 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" 41 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h"
45 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" 42 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h"
46 #include "chrome/browser/ui/hung_plugin_tab_helper.h" 43 #include "chrome/browser/ui/hung_plugin_tab_helper.h"
47 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" 44 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h"
48 #include "chrome/browser/ui/pdf/pdf_tab_helper.h" 45 #include "chrome/browser/ui/pdf/pdf_tab_helper.h"
49 #include "chrome/browser/ui/sad_tab_helper.h" 46 #include "chrome/browser/ui/sad_tab_helper.h"
50 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" 47 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h"
51 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" 48 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h"
52 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" 49 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
53 #include "chrome/browser/ui/zoom/zoom_controller.h" 50 #include "chrome/browser/ui/zoom/zoom_controller.h"
54 #include "components/web_modal/web_contents_modal_dialog_manager.h" 51 #include "components/web_modal/web_contents_modal_dialog_manager.h"
55 #endif // defined(OS_ANDROID) 52 #endif // defined(OS_ANDROID)
56 53
57 #if defined(OS_WIN) 54 #if defined(OS_WIN)
58 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" 55 #include "chrome/browser/ui/metro_pin_tab_helper_win.h"
59 #endif 56 #endif
60 57
61 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) 58 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
62 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" 59 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h"
63 #endif 60 #endif
64 61
65 #if defined(ENABLE_EXTENSIONS) 62 #if defined(ENABLE_EXTENSIONS)
63 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h"
64 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
66 #include "chrome/browser/extensions/tab_helper.h" 65 #include "chrome/browser/extensions/tab_helper.h"
66 #include "extensions/browser/view_type_utils.h"
67 #endif 67 #endif
68 68
69 #if defined(ENABLE_MANAGED_USERS) 69 #if defined(ENABLE_MANAGED_USERS)
70 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h" 70 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h"
71 #endif 71 #endif
72 72
73 #if defined(ENABLE_PRINTING) 73 #if defined(ENABLE_PRINTING)
74 #if defined(ENABLE_FULL_PRINTING) 74 #if defined(ENABLE_FULL_PRINTING)
75 #include "chrome/browser/printing/print_preview_message_handler.h" 75 #include "chrome/browser/printing/print_preview_message_handler.h"
76 #include "chrome/browser/printing/print_view_manager.h" 76 #include "chrome/browser/printing/print_view_manager.h"
(...skipping 20 matching lines...) Expand all
97 // If already adopted, nothing to be done. 97 // If already adopted, nothing to be done.
98 base::SupportsUserData::Data* adoption_tag = 98 base::SupportsUserData::Data* adoption_tag =
99 web_contents->GetUserData(&kTabContentsAttachedTabHelpersUserDataKey); 99 web_contents->GetUserData(&kTabContentsAttachedTabHelpersUserDataKey);
100 if (adoption_tag) 100 if (adoption_tag)
101 return; 101 return;
102 102
103 // Mark as adopted. 103 // Mark as adopted.
104 web_contents->SetUserData(&kTabContentsAttachedTabHelpersUserDataKey, 104 web_contents->SetUserData(&kTabContentsAttachedTabHelpersUserDataKey,
105 new base::SupportsUserData::Data()); 105 new base::SupportsUserData::Data());
106 106
107 #if defined(ENABLE_EXTENSIONS)
107 // Set the view type. 108 // Set the view type.
108 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_TAB_CONTENTS); 109 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_TAB_CONTENTS);
110 #endif
109 111
110 // Create all the tab helpers. 112 // Create all the tab helpers.
111 113
112 // SessionTabHelper comes first because it sets up the tab ID, and other 114 // SessionTabHelper comes first because it sets up the tab ID, and other
113 // helpers may rely on that. 115 // helpers may rely on that.
114 SessionTabHelper::CreateForWebContents(web_contents); 116 SessionTabHelper::CreateForWebContents(web_contents);
115 #if !defined(OS_ANDROID) 117 #if !defined(OS_ANDROID)
116 // ZoomController comes before common tab helpers since ChromeAutofillClient 118 // ZoomController comes before common tab helpers since ChromeAutofillClient
117 // may want to register as a ZoomObserver with it. 119 // may want to register as a ZoomObserver with it.
118 ZoomController::CreateForWebContents(web_contents); 120 ZoomController::CreateForWebContents(web_contents);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 if (OneClickSigninHelper::CanOffer(web_contents, 215 if (OneClickSigninHelper::CanOffer(web_contents,
214 OneClickSigninHelper::CAN_OFFER_FOR_ALL, 216 OneClickSigninHelper::CAN_OFFER_FOR_ALL,
215 std::string(), 217 std::string(),
216 NULL)) { 218 NULL)) {
217 OneClickSigninHelper::CreateForWebContentsWithPasswordManager( 219 OneClickSigninHelper::CreateForWebContentsWithPasswordManager(
218 web_contents, 220 web_contents,
219 ChromePasswordManagerClient::GetManagerFromWebContents(web_contents)); 221 ChromePasswordManagerClient::GetManagerFromWebContents(web_contents));
220 } 222 }
221 #endif 223 #endif
222 } 224 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/chrome_pref_service_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698