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

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

Issue 7383012: Start and stop the safe browsing service depending on whether any profile is using it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 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
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 <set> 5 #include <set>
6 6
7 #include "chrome/browser/profiles/profile_manager.h" 7 #include "chrome/browser/profiles/profile_manager.h"
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/stl_util-inl.h"
13 #include "base/string_number_conversions.h" 14 #include "base/string_number_conversions.h"
14 #include "base/string_util.h" 15 #include "base/string_util.h"
15 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
16 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
17 #include "chrome/browser/prefs/pref_service.h" 18 #include "chrome/browser/prefs/pref_service.h"
18 #include "chrome/browser/prefs/scoped_user_pref_update.h" 19 #include "chrome/browser/prefs/scoped_user_pref_update.h"
19 #include "chrome/browser/profiles/profile_info_cache.h" 20 #include "chrome/browser/profiles/profile_info_cache.h"
20 #include "chrome/browser/sessions/session_service_factory.h" 21 #include "chrome/browser/sessions/session_service_factory.h"
21 #include "chrome/browser/sync/profile_sync_service.h" 22 #include "chrome/browser/sync/profile_sync_service.h"
22 #include "chrome/browser/ui/browser_window.h" 23 #include "chrome/browser/ui/browser_window.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 } 403 }
403 404
404 std::vector<ProfileManagerObserver*> observers_to_delete; 405 std::vector<ProfileManagerObserver*> observers_to_delete;
405 406
406 for (size_t i = 0; i < observers.size(); ++i) { 407 for (size_t i = 0; i < observers.size(); ++i) {
407 observers[i]->OnProfileCreated(profile); 408 observers[i]->OnProfileCreated(profile);
408 if (observers[i]->DeleteAfterCreation()) 409 if (observers[i]->DeleteAfterCreation())
409 observers_to_delete.push_back(observers[i]); 410 observers_to_delete.push_back(observers[i]);
410 } 411 }
411 412
412 observers_to_delete.clear(); 413 STLDeleteElements(&observers_to_delete);
413 } 414 }
414 415
415 // static 416 // static
416 void ProfileManager::CreateMultiProfileAsync() { 417 void ProfileManager::CreateMultiProfileAsync() {
417 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 418 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
418 419
419 // Create the next profile in the next available directory slot. 420 // Create the next profile in the next available directory slot.
420 PrefService* local_state = g_browser_process->local_state(); 421 PrefService* local_state = g_browser_process->local_state();
421 DCHECK(local_state); 422 DCHECK(local_state);
422 423
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 } 551 }
551 552
552 // static 553 // static
553 bool ProfileManager::IsMultipleProfilesEnabled() { 554 bool ProfileManager::IsMultipleProfilesEnabled() {
554 #if defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS) 555 #if defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)
555 return true; 556 return true;
556 #else 557 #else
557 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles); 558 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles);
558 #endif 559 #endif
559 } 560 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/safe_browsing/safe_browsing_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698