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

Side by Side Diff: chrome/browser/profile_impl.cc

Issue 5023001: Handful of related instant changes: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux build Created 10 years, 1 month 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/profile_impl.h ('k') | chrome/browser/search_engines/template_url_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/profile_impl.h" 5 #include "chrome/browser/profile_impl.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 28 matching lines...) Expand all
39 #include "chrome/browser/extensions/user_script_master.h" 39 #include "chrome/browser/extensions/user_script_master.h"
40 #include "chrome/browser/favicon_service.h" 40 #include "chrome/browser/favicon_service.h"
41 #include "chrome/browser/file_system/browser_file_system_context.h" 41 #include "chrome/browser/file_system/browser_file_system_context.h"
42 #include "chrome/browser/find_bar_state.h" 42 #include "chrome/browser/find_bar_state.h"
43 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" 43 #include "chrome/browser/geolocation/geolocation_content_settings_map.h"
44 #include "chrome/browser/geolocation/geolocation_permission_context.h" 44 #include "chrome/browser/geolocation/geolocation_permission_context.h"
45 #include "chrome/browser/history/history.h" 45 #include "chrome/browser/history/history.h"
46 #include "chrome/browser/history/top_sites.h" 46 #include "chrome/browser/history/top_sites.h"
47 #include "chrome/browser/host_content_settings_map.h" 47 #include "chrome/browser/host_content_settings_map.h"
48 #include "chrome/browser/host_zoom_map.h" 48 #include "chrome/browser/host_zoom_map.h"
49 #include "chrome/browser/instant/instant_controller.h"
49 #include "chrome/browser/in_process_webkit/webkit_context.h" 50 #include "chrome/browser/in_process_webkit/webkit_context.h"
50 #include "chrome/browser/net/chrome_url_request_context.h" 51 #include "chrome/browser/net/chrome_url_request_context.h"
51 #include "chrome/browser/net/gaia/token_service.h" 52 #include "chrome/browser/net/gaia/token_service.h"
52 #include "chrome/browser/net/net_pref_observer.h" 53 #include "chrome/browser/net/net_pref_observer.h"
53 #include "chrome/browser/net/ssl_config_service_manager.h" 54 #include "chrome/browser/net/ssl_config_service_manager.h"
54 #include "chrome/browser/notifications/desktop_notification_service.h" 55 #include "chrome/browser/notifications/desktop_notification_service.h"
55 #include "chrome/browser/password_manager/password_store_default.h" 56 #include "chrome/browser/password_manager/password_store_default.h"
56 #include "chrome/browser/prefs/browser_prefs.h" 57 #include "chrome/browser/prefs/browser_prefs.h"
57 #include "chrome/browser/prefs/pref_value_store.h" 58 #include "chrome/browser/prefs/pref_value_store.h"
58 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" 59 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
(...skipping 26 matching lines...) Expand all
85 #include "grit/browser_resources.h" 86 #include "grit/browser_resources.h"
86 #include "grit/locale_settings.h" 87 #include "grit/locale_settings.h"
87 #include "net/base/transport_security_state.h" 88 #include "net/base/transport_security_state.h"
88 #include "webkit/database/database_tracker.h" 89 #include "webkit/database/database_tracker.h"
89 90
90 #if defined(TOOLKIT_USES_GTK) 91 #if defined(TOOLKIT_USES_GTK)
91 #include "chrome/browser/gtk/gtk_theme_provider.h" 92 #include "chrome/browser/gtk/gtk_theme_provider.h"
92 #endif 93 #endif
93 94
94 #if defined(OS_WIN) 95 #if defined(OS_WIN)
96 #include "chrome/browser/instant/promo_counter.h"
95 #include "chrome/browser/password_manager/password_store_win.h" 97 #include "chrome/browser/password_manager/password_store_win.h"
98 #include "chrome/installer/util/install_util.h"
96 #elif defined(OS_MACOSX) 99 #elif defined(OS_MACOSX)
97 #include "chrome/browser/keychain_mac.h" 100 #include "chrome/browser/keychain_mac.h"
98 #include "chrome/browser/password_manager/password_store_mac.h" 101 #include "chrome/browser/password_manager/password_store_mac.h"
99 #elif defined(OS_CHROMEOS) 102 #elif defined(OS_CHROMEOS)
100 #include "chrome/browser/chromeos/proxy_config_service_impl.h" 103 #include "chrome/browser/chromeos/proxy_config_service_impl.h"
101 #elif defined(OS_POSIX) && !defined(OS_CHROMEOS) 104 #elif defined(OS_POSIX) && !defined(OS_CHROMEOS)
102 #include "base/nix/xdg_util.h" 105 #include "base/nix/xdg_util.h"
103 #if defined(USE_GNOME_KEYRING) 106 #if defined(USE_GNOME_KEYRING)
104 #include "chrome/browser/password_manager/native_backend_gnome_x.h" 107 #include "chrome/browser/password_manager/native_backend_gnome_x.h"
105 #endif 108 #endif
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 host_zoom_map_(NULL), 251 host_zoom_map_(NULL),
249 history_service_created_(false), 252 history_service_created_(false),
250 favicon_service_created_(false), 253 favicon_service_created_(false),
251 created_web_data_service_(false), 254 created_web_data_service_(false),
252 created_password_store_(false), 255 created_password_store_(false),
253 created_download_manager_(false), 256 created_download_manager_(false),
254 created_theme_provider_(false), 257 created_theme_provider_(false),
255 start_time_(Time::Now()), 258 start_time_(Time::Now()),
256 spellcheck_host_(NULL), 259 spellcheck_host_(NULL),
257 spellcheck_host_ready_(false), 260 spellcheck_host_ready_(false),
261 #if defined(OS_WIN)
262 checked_instant_promo_(false),
263 #endif
258 shutdown_session_service_(false) { 264 shutdown_session_service_(false) {
259 DCHECK(!path.empty()) << "Using an empty path will attempt to write " << 265 DCHECK(!path.empty()) << "Using an empty path will attempt to write " <<
260 "profile files to the root directory!"; 266 "profile files to the root directory!";
261 create_session_service_timer_.Start( 267 create_session_service_timer_.Start(
262 TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this, 268 TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this,
263 &ProfileImpl::EnsureSessionServiceCreated); 269 &ProfileImpl::EnsureSessionServiceCreated);
264 270
265 PrefService* prefs = GetPrefs(); 271 PrefService* prefs = GetPrefs();
266 pref_change_registrar_.Init(prefs); 272 pref_change_registrar_.Init(prefs);
267 pref_change_registrar_.Add(prefs::kSpellCheckDictionary, this); 273 pref_change_registrar_.Add(prefs::kSpellCheckDictionary, this);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 #endif 347 #endif
342 348
343 background_contents_service_.reset( 349 background_contents_service_.reset(
344 new BackgroundContentsService(this, CommandLine::ForCurrentProcess())); 350 new BackgroundContentsService(this, CommandLine::ForCurrentProcess()));
345 351
346 extension_info_map_ = new ExtensionInfoMap(); 352 extension_info_map_ = new ExtensionInfoMap();
347 353
348 // Log the profile size after a reasonable startup delay. 354 // Log the profile size after a reasonable startup delay.
349 BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE, 355 BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE,
350 new ProfileSizeTask(path_), 112000); 356 new ProfileSizeTask(path_), 112000);
357
358 InstantController::RecordMetrics(this);
351 } 359 }
352 360
353 void ProfileImpl::InitExtensions() { 361 void ProfileImpl::InitExtensions() {
354 if (user_script_master_ || extensions_service_) 362 if (user_script_master_ || extensions_service_)
355 return; // Already initialized. 363 return; // Already initialized.
356 364
357 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 365 const CommandLine* command_line = CommandLine::ForCurrentProcess();
358 if (command_line->HasSwitch( 366 if (command_line->HasSwitch(
359 switches::kEnableExtensionTimelineApi)) { 367 switches::kEnableExtensionTimelineApi)) {
360 extension_devtools_manager_ = new ExtensionDevToolsManager(this); 368 extension_devtools_manager_ = new ExtensionDevToolsManager(this);
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 NewRunnableMethod(blob_storage_context_.get(), 1304 NewRunnableMethod(blob_storage_context_.get(),
1297 &ChromeBlobStorageContext::InitializeOnIOThread)); 1305 &ChromeBlobStorageContext::InitializeOnIOThread));
1298 } 1306 }
1299 return blob_storage_context_; 1307 return blob_storage_context_;
1300 } 1308 }
1301 1309
1302 ExtensionInfoMap* ProfileImpl::GetExtensionInfoMap() { 1310 ExtensionInfoMap* ProfileImpl::GetExtensionInfoMap() {
1303 return extension_info_map_.get(); 1311 return extension_info_map_.get();
1304 } 1312 }
1305 1313
1314 PromoCounter* ProfileImpl::GetInstantPromoCounter() {
1315 #if defined(OS_WIN)
1316 // TODO: enable this when we're ready to turn on the promo.
1317 /*
1318 if (!checked_instant_promo_) {
1319 checked_instant_promo_ = true;
1320 PrefService* prefs = GetPrefs();
1321 if (!prefs->GetBoolean(prefs::kInstantEnabledOnce) &&
1322 !InstantController::IsEnabled(this) &&
1323 InstallUtil::IsChromeSxSProcess()) {
1324 DCHECK(!instant_promo_counter_.get());
1325 instant_promo_counter_.reset(
1326 new PromoCounter(this, prefs::kInstantPromo, "Instant.Promo", 3, 3));
1327 }
1328 }
1329 */
1330 return instant_promo_counter_.get();
1331 #else
1332 return NULL;
1333 #endif
1334 }
1335
1306 #if defined(OS_CHROMEOS) 1336 #if defined(OS_CHROMEOS)
1307 chromeos::ProxyConfigServiceImpl* 1337 chromeos::ProxyConfigServiceImpl*
1308 ProfileImpl::GetChromeOSProxyConfigServiceImpl() { 1338 ProfileImpl::GetChromeOSProxyConfigServiceImpl() {
1309 if (!chromeos_proxy_config_service_impl_) { 1339 if (!chromeos_proxy_config_service_impl_) {
1310 chromeos_proxy_config_service_impl_ = 1340 chromeos_proxy_config_service_impl_ =
1311 new chromeos::ProxyConfigServiceImpl(); 1341 new chromeos::ProxyConfigServiceImpl();
1312 } 1342 }
1313 return chromeos_proxy_config_service_impl_; 1343 return chromeos_proxy_config_service_impl_;
1314 } 1344 }
1315 #endif // defined(OS_CHROMEOS) 1345 #endif // defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/profile_impl.h ('k') | chrome/browser/search_engines/template_url_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698