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

Side by Side Diff: extensions/browser/extension_prefs.cc

Issue 219593002: Add unit test for the Settings API Bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced Created 6 years, 8 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
« no previous file with comments | « chrome/chrome_browser_extensions.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/extension_prefs.h" 5 #include "extensions/browser/extension_prefs.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/prefs/pref_notifier.h" 10 #include "base/prefs/pref_notifier.h"
(...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after
1853 DVLOG(1) << "SetInstallSignature - saving"; 1853 DVLOG(1) << "SetInstallSignature - saving";
1854 } else { 1854 } else {
1855 DVLOG(1) << "SetInstallSignature - clearing"; 1855 DVLOG(1) << "SetInstallSignature - clearing";
1856 prefs_->ClearPref(kInstallSignature); 1856 prefs_->ClearPref(kInstallSignature);
1857 } 1857 }
1858 } 1858 }
1859 1859
1860 std::string ExtensionPrefs::GetInstallParam( 1860 std::string ExtensionPrefs::GetInstallParam(
1861 const std::string& extension_id) const { 1861 const std::string& extension_id) const {
1862 const base::DictionaryValue* extension = GetExtensionPref(extension_id); 1862 const base::DictionaryValue* extension = GetExtensionPref(extension_id);
1863 if (!extension) { 1863 if (!extension) // Expected during unit testing.
1864 NOTREACHED();
1865 return std::string(); 1864 return std::string();
1866 }
1867 std::string install_parameter; 1865 std::string install_parameter;
1868 if (!extension->GetString(kPrefInstallParam, &install_parameter)) 1866 if (!extension->GetString(kPrefInstallParam, &install_parameter))
1869 return std::string(); 1867 return std::string();
1870 return install_parameter; 1868 return install_parameter;
1871 } 1869 }
1872 1870
1873 void ExtensionPrefs::SetInstallParam(const std::string& extension_id, 1871 void ExtensionPrefs::SetInstallParam(const std::string& extension_id,
1874 const std::string& install_parameter) { 1872 const std::string& install_parameter) {
1875 UpdateExtensionPref(extension_id, 1873 UpdateExtensionPref(extension_id,
1876 kPrefInstallParam, 1874 kPrefInstallParam,
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 extension_pref_value_map_->RegisterExtension( 2155 extension_pref_value_map_->RegisterExtension(
2158 extension_id, install_time, is_enabled, is_incognito_enabled); 2156 extension_id, install_time, is_enabled, is_incognito_enabled);
2159 2157
2160 FOR_EACH_OBSERVER( 2158 FOR_EACH_OBSERVER(
2161 ExtensionPrefsObserver, 2159 ExtensionPrefsObserver,
2162 observer_list_, 2160 observer_list_,
2163 OnExtensionRegistered(extension_id, install_time, is_enabled)); 2161 OnExtensionRegistered(extension_id, install_time, is_enabled));
2164 } 2162 }
2165 2163
2166 } // namespace extensions 2164 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/chrome_browser_extensions.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698