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

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

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 | 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"
(...skipping 16 matching lines...) Expand all
27 #include "chrome/browser/ui/browser_window.h" 27 #include "chrome/browser/ui/browser_window.h"
28 #include "chrome/browser/ui/webui/sync_promo_ui.h" 28 #include "chrome/browser/ui/webui/sync_promo_ui.h"
29 #include "chrome/common/chrome_notification_types.h" 29 #include "chrome/common/chrome_notification_types.h"
30 #include "chrome/common/chrome_constants.h" 30 #include "chrome/common/chrome_constants.h"
31 #include "chrome/common/chrome_switches.h" 31 #include "chrome/common/chrome_switches.h"
32 #include "chrome/common/logging_chrome.h" 32 #include "chrome/common/logging_chrome.h"
33 #include "chrome/common/pref_names.h" 33 #include "chrome/common/pref_names.h"
34 #include "chrome/common/url_constants.h" 34 #include "chrome/common/url_constants.h"
35 #include "content/browser/browser_thread.h" 35 #include "content/browser/browser_thread.h"
36 #include "content/browser/user_metrics.h" 36 #include "content/browser/user_metrics.h"
37 #include "content/common/notification_service.h" 37 #include "content/public/browser/notification_service.h"
38 #include "grit/generated_resources.h" 38 #include "grit/generated_resources.h"
39 #include "net/http/http_transaction_factory.h" 39 #include "net/http/http_transaction_factory.h"
40 #include "net/url_request/url_request_context.h" 40 #include "net/url_request/url_request_context.h"
41 #include "net/url_request/url_request_context_getter.h" 41 #include "net/url_request/url_request_context_getter.h"
42 #include "net/url_request/url_request_job.h" 42 #include "net/url_request/url_request_job.h"
43 #include "ui/base/l10n/l10n_util.h" 43 #include "ui/base/l10n/l10n_util.h"
44 44
45 #if defined(OS_CHROMEOS) 45 #if defined(OS_CHROMEOS)
46 #include "chrome/browser/chromeos/cros/cros_library.h" 46 #include "chrome/browser/chromeos/cros/cros_library.h"
47 #include "chrome/browser/chromeos/cros/cryptohome_library.h" 47 #include "chrome/browser/chromeos/cros/cryptohome_library.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 ProfileManager::ProfileManager(const FilePath& user_data_dir) 199 ProfileManager::ProfileManager(const FilePath& user_data_dir)
200 : user_data_dir_(user_data_dir), 200 : user_data_dir_(user_data_dir),
201 logged_in_(false), 201 logged_in_(false),
202 will_import_(false) { 202 will_import_(false) {
203 BrowserList::AddObserver(this); 203 BrowserList::AddObserver(this);
204 #if defined(OS_CHROMEOS) 204 #if defined(OS_CHROMEOS)
205 registrar_.Add( 205 registrar_.Add(
206 this, 206 this,
207 chrome::NOTIFICATION_LOGIN_USER_CHANGED, 207 chrome::NOTIFICATION_LOGIN_USER_CHANGED,
208 NotificationService::AllSources()); 208 content::NotificationService::AllSources());
209 #endif 209 #endif
210 } 210 }
211 211
212 ProfileManager::~ProfileManager() { 212 ProfileManager::~ProfileManager() {
213 BrowserList::RemoveObserver(this); 213 BrowserList::RemoveObserver(this);
214 } 214 }
215 215
216 FilePath ProfileManager::GetDefaultProfileDir( 216 FilePath ProfileManager::GetDefaultProfileDir(
217 const FilePath& user_data_dir) { 217 const FilePath& user_data_dir) {
218 FilePath default_profile_dir(user_data_dir); 218 FilePath default_profile_dir(user_data_dir);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 #endif 434 #endif
435 } 435 }
436 436
437 void ProfileManager::SetWillImport() { 437 void ProfileManager::SetWillImport() {
438 will_import_ = true; 438 will_import_ = true;
439 } 439 }
440 440
441 void ProfileManager::OnImportFinished(Profile* profile) { 441 void ProfileManager::OnImportFinished(Profile* profile) {
442 will_import_ = false; 442 will_import_ = false;
443 DCHECK(profile); 443 DCHECK(profile);
444 NotificationService::current()->Notify( 444 content::NotificationService::current()->Notify(
445 chrome::NOTIFICATION_IMPORT_FINISHED, 445 chrome::NOTIFICATION_IMPORT_FINISHED,
446 content::Source<Profile>(profile), 446 content::Source<Profile>(profile),
447 NotificationService::NoDetails()); 447 content::NotificationService::NoDetails());
448 } 448 }
449 449
450 void ProfileManager::OnBrowserAdded(const Browser* browser) {} 450 void ProfileManager::OnBrowserAdded(const Browser* browser) {}
451 451
452 void ProfileManager::OnBrowserRemoved(const Browser* browser) {} 452 void ProfileManager::OnBrowserRemoved(const Browser* browser) {}
453 453
454 void ProfileManager::OnBrowserSetLastActive(const Browser* browser) { 454 void ProfileManager::OnBrowserSetLastActive(const Browser* browser) {
455 Profile* last_active = browser->GetProfile(); 455 Profile* last_active = browser->GetProfile();
456 PrefService* local_state = g_browser_process->local_state(); 456 PrefService* local_state = g_browser_process->local_state();
457 DCHECK(local_state); 457 DCHECK(local_state);
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 652 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
653 const FilePath& user_data_dir) : ProfileManager(user_data_dir) { 653 const FilePath& user_data_dir) : ProfileManager(user_data_dir) {
654 } 654 }
655 655
656 void ProfileManager::RegisterTestingProfile(Profile* profile, 656 void ProfileManager::RegisterTestingProfile(Profile* profile,
657 bool add_to_cache) { 657 bool add_to_cache) {
658 RegisterProfile(profile, true); 658 RegisterProfile(profile, true);
659 if (add_to_cache) 659 if (add_to_cache)
660 AddProfileToCache(profile); 660 AddProfileToCache(profile);
661 } 661 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_io_data.cc ('k') | chrome/browser/profiles/profile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698