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

Side by Side Diff: chrome/browser/profiles/profile_manager.cc

Issue 665703002: Activate data reduction proxy after profile initialization is complete. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 6 years, 2 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
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/profiles/profile_manager.h" 5 #include "chrome/browser/profiles/profile_manager.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/debug/trace_event.h" 11 #include "base/debug/trace_event.h"
12 #include "base/deferred_sequenced_task_runner.h" 12 #include "base/deferred_sequenced_task_runner.h"
13 #include "base/files/file_enumerator.h" 13 #include "base/files/file_enumerator.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/files/file_util.h" 15 #include "base/files/file_util.h"
16 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
17 #include "base/prefs/pref_service.h" 17 #include "base/prefs/pref_service.h"
18 #include "base/prefs/scoped_user_pref_update.h" 18 #include "base/prefs/scoped_user_pref_update.h"
19 #include "base/strings/string_number_conversions.h" 19 #include "base/strings/string_number_conversions.h"
20 #include "base/strings/string_util.h" 20 #include "base/strings/string_util.h"
21 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
22 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 22 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
23 #include "chrome/browser/browser_process.h" 23 #include "chrome/browser/browser_process.h"
24 #include "chrome/browser/chrome_notification_types.h" 24 #include "chrome/browser/chrome_notification_types.h"
25 #include "chrome/browser/content_settings/host_content_settings_map.h" 25 #include "chrome/browser/content_settings/host_content_settings_map.h"
26 #include "chrome/browser/download/download_service.h" 26 #include "chrome/browser/download/download_service.h"
27 #include "chrome/browser/download/download_service_factory.h" 27 #include "chrome/browser/download/download_service_factory.h"
28 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
29 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h"
28 #include "chrome/browser/password_manager/password_store_factory.h" 30 #include "chrome/browser/password_manager/password_store_factory.h"
29 #include "chrome/browser/prefs/incognito_mode_prefs.h" 31 #include "chrome/browser/prefs/incognito_mode_prefs.h"
30 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" 32 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h"
31 #include "chrome/browser/profiles/profile_avatar_icon_util.h" 33 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
32 #include "chrome/browser/profiles/profile_destroyer.h" 34 #include "chrome/browser/profiles/profile_destroyer.h"
33 #include "chrome/browser/profiles/profile_info_cache.h" 35 #include "chrome/browser/profiles/profile_info_cache.h"
34 #include "chrome/browser/profiles/profile_metrics.h" 36 #include "chrome/browser/profiles/profile_metrics.h"
35 #include "chrome/browser/profiles/profiles_state.h" 37 #include "chrome/browser/profiles/profiles_state.h"
36 #include "chrome/browser/profiles/startup_task_runner_service.h" 38 #include "chrome/browser/profiles/startup_task_runner_service.h"
37 #include "chrome/browser/profiles/startup_task_runner_service_factory.h" 39 #include "chrome/browser/profiles/startup_task_runner_service_factory.h"
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 RunCallbacks(callbacks, profile, 976 RunCallbacks(callbacks, profile,
975 profile ? Profile::CREATE_STATUS_INITIALIZED : 977 profile ? Profile::CREATE_STATUS_INITIALIZED :
976 Profile::CREATE_STATUS_LOCAL_FAIL); 978 Profile::CREATE_STATUS_LOCAL_FAIL);
977 } 979 }
978 980
979 void ProfileManager::DoFinalInit(Profile* profile, bool go_off_the_record) { 981 void ProfileManager::DoFinalInit(Profile* profile, bool go_off_the_record) {
980 DoFinalInitForServices(profile, go_off_the_record); 982 DoFinalInitForServices(profile, go_off_the_record);
981 AddProfileToCache(profile); 983 AddProfileToCache(profile);
982 DoFinalInitLogging(profile); 984 DoFinalInitLogging(profile);
983 985
986 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile)->
bengr 2014/10/22 00:46:43 What happens in incognito?
Not at Google. Contact bengr 2014/10/22 20:03:42 This code does not run for incognito.
987 MaybeActivateDataReductionProxy(true);
988
984 ProfileMetrics::LogNumberOfProfiles(this); 989 ProfileMetrics::LogNumberOfProfiles(this);
985 content::NotificationService::current()->Notify( 990 content::NotificationService::current()->Notify(
986 chrome::NOTIFICATION_PROFILE_ADDED, 991 chrome::NOTIFICATION_PROFILE_ADDED,
987 content::Source<Profile>(profile), 992 content::Source<Profile>(profile),
988 content::NotificationService::NoDetails()); 993 content::NotificationService::NoDetails());
989 } 994 }
990 995
991 void ProfileManager::DoFinalInitForServices(Profile* profile, 996 void ProfileManager::DoFinalInitForServices(Profile* profile,
992 bool go_off_the_record) { 997 bool go_off_the_record) {
993 #if defined(ENABLE_EXTENSIONS) 998 #if defined(ENABLE_EXTENSIONS)
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); 1326 last_non_supervised_profile_path.BaseName().MaybeAsASCII());
1322 FinishDeletingProfile(profile_to_delete_path); 1327 FinishDeletingProfile(profile_to_delete_path);
1323 } 1328 }
1324 } 1329 }
1325 } 1330 }
1326 #endif 1331 #endif
1327 1332
1328 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1333 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1329 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1334 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1330 } 1335 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698