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

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

Issue 9564001: Clean up password manager code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a unit test for sub-frame navigation Created 8 years, 9 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) 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_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 chrome::NOTIFICATION_PROFILE_DESTROYED, 556 chrome::NOTIFICATION_PROFILE_DESTROYED,
557 content::Source<Profile>(this), 557 content::Source<Profile>(this),
558 content::NotificationService::NoDetails()); 558 content::NotificationService::NoDetails());
559 // Save the session state if we're going to restore the session during the 559 // Save the session state if we're going to restore the session during the
560 // next startup. 560 // next startup.
561 SessionStartupPref pref = SessionStartupPref::GetStartupPref(this); 561 SessionStartupPref pref = SessionStartupPref::GetStartupPref(this);
562 if (pref.type == SessionStartupPref::LAST) { 562 if (pref.type == SessionStartupPref::LAST) {
563 if (session_restore_enabled_) 563 if (session_restore_enabled_)
564 BrowserContext::SaveSessionState(this); 564 BrowserContext::SaveSessionState(this);
565 } else if (clear_local_state_on_exit_) { 565 } else if (clear_local_state_on_exit_) {
566 BrowserContext::ClearLocalOnDestruction(this); 566 BrowserContext::ClearLocalOnDestruction(this);
567 } 567 }
568 568
569 StopCreateSessionServiceTimer(); 569 StopCreateSessionServiceTimer();
570 570
571 // Remove pref observers 571 // Remove pref observers
572 pref_change_registrar_.RemoveAll(); 572 pref_change_registrar_.RemoveAll();
573 573
574 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( 574 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext(
575 io_data_.GetResourceContextNoInit()); 575 io_data_.GetResourceContextNoInit());
576 576
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 } 644 }
645 645
646 std::string ProfileImpl::GetProfileName() { 646 std::string ProfileImpl::GetProfileName() {
647 return GetPrefs()->GetString(prefs::kGoogleServicesUsername); 647 return GetPrefs()->GetString(prefs::kGoogleServicesUsername);
648 } 648 }
649 649
650 FilePath ProfileImpl::GetPath() { 650 FilePath ProfileImpl::GetPath() {
651 return path_; 651 return path_;
652 } 652 }
653 653
654 bool ProfileImpl::IsOffTheRecord() { 654 bool ProfileImpl::IsOffTheRecord() const {
655 return false; 655 return false;
656 } 656 }
657 657
658 Profile* ProfileImpl::GetOffTheRecordProfile() { 658 Profile* ProfileImpl::GetOffTheRecordProfile() {
659 if (!off_the_record_profile_.get()) { 659 if (!off_the_record_profile_.get()) {
660 scoped_ptr<Profile> p(CreateOffTheRecordProfile()); 660 scoped_ptr<Profile> p(CreateOffTheRecordProfile());
661 off_the_record_profile_.swap(p); 661 off_the_record_profile_.swap(p);
662 662
663 content::NotificationService::current()->Notify( 663 content::NotificationService::current()->Notify(
664 chrome::NOTIFICATION_PROFILE_CREATED, 664 chrome::NOTIFICATION_PROFILE_CREATED,
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 FilePath* cache_path, 1461 FilePath* cache_path,
1462 int* max_size) { 1462 int* max_size) {
1463 DCHECK(cache_path); 1463 DCHECK(cache_path);
1464 DCHECK(max_size); 1464 DCHECK(max_size);
1465 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); 1465 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir));
1466 if (!path.empty()) 1466 if (!path.empty())
1467 *cache_path = path; 1467 *cache_path = path;
1468 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : 1468 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) :
1469 prefs_->GetInteger(prefs::kDiskCacheSize); 1469 prefs_->GetInteger(prefs::kDiskCacheSize);
1470 } 1470 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698