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

Side by Side Diff: chrome/browser/browser_process_impl.cc

Issue 6992081: Make --allow-cross-domain-auth-prompt equivalent to a preference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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/browser_process_impl.h" 5 #include "chrome/browser/browser_process_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 if (!created_safe_browsing_detection_service_) { 640 if (!created_safe_browsing_detection_service_) {
641 CreateSafeBrowsingDetectionService(); 641 CreateSafeBrowsingDetectionService();
642 } 642 }
643 return safe_browsing_detection_service_.get(); 643 return safe_browsing_detection_service_.get();
644 } 644 }
645 645
646 bool BrowserProcessImpl::plugin_finder_disabled() const { 646 bool BrowserProcessImpl::plugin_finder_disabled() const {
647 return *plugin_finder_disabled_pref_; 647 return *plugin_finder_disabled_pref_;
648 } 648 }
649 649
650 bool BrowserProcessImpl::allow_cross_origin_auth_prompt() const {
651 return *allow_cross_origin_auth_prompt_pref_;
652 }
653
650 void BrowserProcessImpl::Observe(NotificationType type, 654 void BrowserProcessImpl::Observe(NotificationType type,
651 const NotificationSource& source, 655 const NotificationSource& source,
652 const NotificationDetails& details) { 656 const NotificationDetails& details) {
653 if (type == NotificationType::APP_TERMINATING) { 657 if (type == NotificationType::APP_TERMINATING) {
654 Profile* profile = ProfileManager::GetDefaultProfile(); 658 Profile* profile = ProfileManager::GetDefaultProfile();
655 if (profile) { 659 if (profile) {
656 PrefService* prefs = profile->GetPrefs(); 660 PrefService* prefs = profile->GetPrefs();
657 if (prefs->GetBoolean(prefs::kClearSiteDataOnExit) && 661 if (prefs->GetBoolean(prefs::kClearSiteDataOnExit) &&
658 local_state()->GetBoolean(prefs::kClearPluginLSODataEnabled)) { 662 local_state()->GetBoolean(prefs::kClearPluginLSODataEnabled)) {
659 plugin_data_remover_ = new PluginDataRemover(); 663 plugin_data_remover_ = new PluginDataRemover();
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 } 916 }
913 pref_change_registrar_.Add(prefs::kDefaultBrowserSettingEnabled, this); 917 pref_change_registrar_.Add(prefs::kDefaultBrowserSettingEnabled, this);
914 918
915 // Initialize the preference for the plugin finder policy. 919 // Initialize the preference for the plugin finder policy.
916 // This preference is only needed on the IO thread so make it available there. 920 // This preference is only needed on the IO thread so make it available there.
917 local_state_->RegisterBooleanPref(prefs::kDisablePluginFinder, false); 921 local_state_->RegisterBooleanPref(prefs::kDisablePluginFinder, false);
918 plugin_finder_disabled_pref_.Init(prefs::kDisablePluginFinder, 922 plugin_finder_disabled_pref_.Init(prefs::kDisablePluginFinder,
919 local_state_.get(), NULL); 923 local_state_.get(), NULL);
920 plugin_finder_disabled_pref_.MoveToThread(BrowserThread::IO); 924 plugin_finder_disabled_pref_.MoveToThread(BrowserThread::IO);
921 925
926 // The cross origin auth prompt preference is only neeed on the IO thread.
927 local_state_->RegisterBooleanPref(prefs::kAllowCrossOriginAuthPrompt, false);
928 allow_cross_origin_auth_prompt_pref_.Init(
929 prefs::kAllowCrossOriginAuthPrompt, local_state_.get(), NULL);
930 allow_cross_origin_auth_prompt_pref_.MoveToThread(BrowserThread::IO);
931
922 // This is observed by ChildProcessSecurityPolicy, which lives in content/ 932 // This is observed by ChildProcessSecurityPolicy, which lives in content/
923 // though, so it can't register itself. 933 // though, so it can't register itself.
924 local_state_->RegisterListPref(prefs::kDisabledSchemes); 934 local_state_->RegisterListPref(prefs::kDisabledSchemes);
925 pref_change_registrar_.Add(prefs::kDisabledSchemes, this); 935 pref_change_registrar_.Add(prefs::kDisabledSchemes, this);
926 ApplyDisabledSchemesPolicy(); 936 ApplyDisabledSchemesPolicy();
927 } 937 }
928 938
929 void BrowserProcessImpl::CreateIconManager() { 939 void BrowserProcessImpl::CreateIconManager() {
930 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); 940 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL);
931 created_icon_manager_ = true; 941 created_icon_manager_ = true;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 } 1129 }
1120 1130
1121 void BrowserProcessImpl::OnAutoupdateTimer() { 1131 void BrowserProcessImpl::OnAutoupdateTimer() {
1122 if (CanAutorestartForUpdate()) { 1132 if (CanAutorestartForUpdate()) {
1123 DLOG(WARNING) << "Detected update. Restarting browser."; 1133 DLOG(WARNING) << "Detected update. Restarting browser.";
1124 RestartPersistentInstance(); 1134 RestartPersistentInstance();
1125 } 1135 }
1126 } 1136 }
1127 1137
1128 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1138 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698