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

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

Issue 7467012: Modifying prefetch to account for multi-profile. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 5 #include "chrome/browser/profiles/profile.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/file_path.h" 11 #include "base/file_path.h"
12 #include "base/file_util.h" 12 #include "base/file_util.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/path_service.h" 14 #include "base/path_service.h"
15 #include "base/string_util.h" 15 #include "base/string_util.h"
16 #include "build/build_config.h" 16 #include "build/build_config.h"
17 #include "chrome/browser/background/background_contents_service_factory.h" 17 #include "chrome/browser/background/background_contents_service_factory.h"
18 #include "chrome/browser/browser_process.h" 18 #include "chrome/browser/browser_process.h"
19 #include "chrome/browser/content_settings/host_content_settings_map.h" 19 #include "chrome/browser/content_settings/host_content_settings_map.h"
20 #include "chrome/browser/download/chrome_download_manager_delegate.h" 20 #include "chrome/browser/download/chrome_download_manager_delegate.h"
21 #include "chrome/browser/download/download_manager.h" 21 #include "chrome/browser/download/download_manager.h"
22 #include "chrome/browser/extensions/extension_info_map.h" 22 #include "chrome/browser/extensions/extension_info_map.h"
23 #include "chrome/browser/extensions/extension_message_service.h" 23 #include "chrome/browser/extensions/extension_message_service.h"
24 #include "chrome/browser/extensions/extension_pref_store.h" 24 #include "chrome/browser/extensions/extension_pref_store.h"
25 #include "chrome/browser/extensions/extension_process_manager.h" 25 #include "chrome/browser/extensions/extension_process_manager.h"
26 #include "chrome/browser/extensions/extension_service.h" 26 #include "chrome/browser/extensions/extension_service.h"
27 #include "chrome/browser/extensions/extension_special_storage_policy.h" 27 #include "chrome/browser/extensions/extension_special_storage_policy.h"
28 #include "chrome/browser/extensions/extension_webrequest_api.h" 28 #include "chrome/browser/extensions/extension_webrequest_api.h"
29 #include "chrome/browser/net/predictor.h"
29 #include "chrome/browser/net/pref_proxy_config_service.h" 30 #include "chrome/browser/net/pref_proxy_config_service.h"
30 #include "chrome/browser/prefs/incognito_mode_prefs.h" 31 #include "chrome/browser/prefs/incognito_mode_prefs.h"
31 #include "chrome/browser/prefs/pref_service.h" 32 #include "chrome/browser/prefs/pref_service.h"
32 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" 33 #include "chrome/browser/profiles/off_the_record_profile_io_data.h"
33 #include "chrome/browser/profiles/profile_dependency_manager.h" 34 #include "chrome/browser/profiles/profile_dependency_manager.h"
34 #include "chrome/browser/sync/profile_sync_service.h" 35 #include "chrome/browser/sync/profile_sync_service.h"
35 #include "chrome/browser/themes/theme_service.h" 36 #include "chrome/browser/themes/theme_service.h"
36 #include "chrome/browser/transport_security_persister.h" 37 #include "chrome/browser/transport_security_persister.h"
37 #include "chrome/browser/ui/browser_list.h" 38 #include "chrome/browser/ui/browser_list.h"
38 #include "chrome/browser/ui/find_bar/find_bar_state.h" 39 #include "chrome/browser/ui/find_bar/find_bar_state.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 #endif 226 #endif
226 } 227 }
227 228
228 bool Profile::IsSyncAccessible() { 229 bool Profile::IsSyncAccessible() {
229 ProfileSyncService* syncService = GetProfileSyncService(); 230 ProfileSyncService* syncService = GetProfileSyncService();
230 return syncService && !syncService->IsManaged(); 231 return syncService && !syncService->IsManaged();
231 } 232 }
232 233
233 //////////////////////////////////////////////////////////////////////////////// 234 ////////////////////////////////////////////////////////////////////////////////
234 // 235 //
236 // This section supports the about:dns page.
237 //
238 ////////////////////////////////////////////////////////////////////////////////
239
240 // Provide global support for the about:dns page.
241 void Profile::PredictorGetHtmlInfo(std::string* output) {
242 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
243
244 output->append("<html><head><title>About DNS</title>"
245 // We'd like the following no-cache... but it doesn't work.
246 // "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">"
247 "</head><body>");
248 chrome_browser_net::Predictor* predictor = GetNetworkPredictor();
249 if (predictor && predictor->predictor_enabled()) {
250 predictor->GetHtmlInfo(output);
251 } else {
252 output->append("DNS pre-resolution and TCP pre-connection is disabled.");
253 }
254 output->append("</body></html>");
255 }
256
257 ////////////////////////////////////////////////////////////////////////////////
258 //
235 // OffTheRecordProfileImpl is a profile subclass that wraps an existing profile 259 // OffTheRecordProfileImpl is a profile subclass that wraps an existing profile
236 // to make it suitable for the incognito mode. 260 // to make it suitable for the incognito mode.
237 // 261 //
238 //////////////////////////////////////////////////////////////////////////////// 262 ////////////////////////////////////////////////////////////////////////////////
239 class OffTheRecordProfileImpl : public Profile, 263 class OffTheRecordProfileImpl : public Profile,
240 public BrowserList::Observer { 264 public BrowserList::Observer {
241 public: 265 public:
242 explicit OffTheRecordProfileImpl(Profile* real_profile) 266 explicit OffTheRecordProfileImpl(Profile* real_profile)
243 : profile_(real_profile), 267 : profile_(real_profile),
244 prefs_(real_profile->GetOffTheRecordPrefs()), 268 prefs_(real_profile->GetOffTheRecordPrefs()),
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 }; 898 };
875 #endif 899 #endif
876 900
877 Profile* Profile::CreateOffTheRecordProfile() { 901 Profile* Profile::CreateOffTheRecordProfile() {
878 #if defined(OS_CHROMEOS) 902 #if defined(OS_CHROMEOS)
879 if (Profile::IsGuestSession()) 903 if (Profile::IsGuestSession())
880 return new GuestSessionProfile(this); 904 return new GuestSessionProfile(this);
881 #endif 905 #endif
882 return new OffTheRecordProfileImpl(this); 906 return new OffTheRecordProfileImpl(this);
883 } 907 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698