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

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

Issue 8060017: Ensure that --disable-extensions disables extension prefs from being enacted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split ExtensionPrefs constructor into constructor and Init function 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 "chrome/browser/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 925
926 // The last session exited cleanly if there is no pref for 926 // The last session exited cleanly if there is no pref for
927 // kSessionExitedCleanly or the value for kSessionExitedCleanly is true. 927 // kSessionExitedCleanly or the value for kSessionExitedCleanly is true.
928 last_session_exited_cleanly_ = 928 last_session_exited_cleanly_ =
929 prefs_->GetBoolean(prefs::kSessionExitedCleanly); 929 prefs_->GetBoolean(prefs::kSessionExitedCleanly);
930 // Mark the session as open. 930 // Mark the session as open.
931 prefs_->SetBoolean(prefs::kSessionExitedCleanly, false); 931 prefs_->SetBoolean(prefs::kSessionExitedCleanly, false);
932 // Make sure we save to disk that the session has opened. 932 // Make sure we save to disk that the session has opened.
933 prefs_->ScheduleSavePersistentPrefs(); 933 prefs_->ScheduleSavePersistentPrefs();
934 934
935 bool extensions_disabled =
936 prefs_->GetBoolean(prefs::kDisableExtensions) ||
937 CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableExtensions);
938
935 // Ensure that preferences set by extensions are restored in the profile 939 // Ensure that preferences set by extensions are restored in the profile
936 // as early as possible. The constructor takes care of that. 940 // as early as possible. The constructor takes care of that.
937 extension_prefs_.reset(new ExtensionPrefs( 941 extension_prefs_.reset(new ExtensionPrefs(
938 prefs_.get(), 942 prefs_.get(),
939 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), 943 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName),
940 GetExtensionPrefValueMap())); 944 GetExtensionPrefValueMap()));
945 extension_prefs_->Init(extensions_disabled);
941 946
942 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); 947 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false);
943 948
944 DCHECK(!net_pref_observer_.get()); 949 DCHECK(!net_pref_observer_.get());
945 net_pref_observer_.reset( 950 net_pref_observer_.reset(
946 new NetPrefObserver(prefs_.get(), GetPrerenderManager(), predictor_)); 951 new NetPrefObserver(prefs_.get(), GetPrerenderManager(), predictor_));
947 952
948 DoFinalInit(); 953 DoFinalInit();
949 } 954 }
950 955
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
1764 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { 1769 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() {
1765 if (!spellcheck_profile_.get()) 1770 if (!spellcheck_profile_.get())
1766 spellcheck_profile_.reset(new SpellCheckProfile()); 1771 spellcheck_profile_.reset(new SpellCheckProfile());
1767 return spellcheck_profile_.get(); 1772 return spellcheck_profile_.get();
1768 } 1773 }
1769 1774
1770 void ProfileImpl::SetDownloadManagerDelegate( 1775 void ProfileImpl::SetDownloadManagerDelegate(
1771 ChromeDownloadManagerDelegate* delegate) { 1776 ChromeDownloadManagerDelegate* delegate) {
1772 download_manager_delegate_ = delegate; 1777 download_manager_delegate_ = delegate;
1773 } 1778 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698