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

Side by Side Diff: chrome/browser/extensions/api/settings_private/prefs_util.cc

Issue 2520573002: MD Settings: implement support for extension-controlled startup URLs (Closed)
Patch Set: fix closure? Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/extensions/api/settings_private/prefs_util.h" 5 #include "chrome/browser/extensions/api/settings_private/prefs_util.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/extensions/chrome_extension_function.h" 9 #include "chrome/browser/extensions/chrome_extension_function.h"
10 #include "chrome/browser/extensions/settings_api_helpers.h" 10 #include "chrome/browser/extensions/settings_api_helpers.h"
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 return false; 689 return false;
690 #endif 690 #endif
691 } 691 }
692 692
693 const Extension* PrefsUtil::GetExtensionControllingPref( 693 const Extension* PrefsUtil::GetExtensionControllingPref(
694 const settings_private::PrefObject& pref_object) { 694 const settings_private::PrefObject& pref_object) {
695 // Look for specific prefs that might be extension controlled. This generally 695 // Look for specific prefs that might be extension controlled. This generally
696 // corresponds with some indiciator that should be shown in the settings UI. 696 // corresponds with some indiciator that should be shown in the settings UI.
697 if (pref_object.key == ::prefs::kHomePage) 697 if (pref_object.key == ::prefs::kHomePage)
698 return GetExtensionOverridingHomepage(profile_); 698 return GetExtensionOverridingHomepage(profile_);
699
700 if (pref_object.key == ::prefs::kRestoreOnStartup) {
701 int restore_on_startup;
702 CHECK(pref_object.value->GetAsInteger(&restore_on_startup));
703
704 if (restore_on_startup == SessionStartupPref::kPrefValueURLs)
705 return GetExtensionOverridingStartupPages(profile_);
706 }
707
699 if (pref_object.key == ::prefs::kURLsToRestoreOnStartup) 708 if (pref_object.key == ::prefs::kURLsToRestoreOnStartup)
700 return GetExtensionOverridingStartupPages(profile_); 709 return GetExtensionOverridingStartupPages(profile_);
710
701 if (pref_object.key == ::prefs::kDefaultSearchProviderEnabled) 711 if (pref_object.key == ::prefs::kDefaultSearchProviderEnabled)
702 return GetExtensionOverridingSearchEngine(profile_); 712 return GetExtensionOverridingSearchEngine(profile_);
713
703 if (pref_object.key == proxy_config::prefs::kProxy) 714 if (pref_object.key == proxy_config::prefs::kProxy)
704 return GetExtensionOverridingProxy(profile_); 715 return GetExtensionOverridingProxy(profile_);
716
705 return nullptr; 717 return nullptr;
706 } 718 }
707 719
708 } // namespace extensions 720 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698