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

Side by Side Diff: chrome/browser/extensions/settings/settings_api.cc

Issue 8587025: Extension settings API: force through changes that come from sync (ignoring (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 9 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 | 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/extensions/settings/settings_api.h" 5 #include "chrome/browser/extensions/settings/settings_api.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/settings/settings_frontend.h" 10 #include "chrome/browser/extensions/settings/settings_frontend.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 SettingsStorage::ReadResult(kUnsupportedArgumentType)); 141 SettingsStorage::ReadResult(kUnsupportedArgumentType));
142 } 142 }
143 } 143 }
144 144
145 bool SetSettingsFunction::RunWithStorage( 145 bool SetSettingsFunction::RunWithStorage(
146 scoped_refptr<SettingsObserverList> observers, 146 scoped_refptr<SettingsObserverList> observers,
147 SettingsStorage* storage) { 147 SettingsStorage* storage) {
148 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 148 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
149 DictionaryValue *input; 149 DictionaryValue *input;
150 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &input)); 150 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &input));
151 return UseWriteResult(observers, storage->Set(*input)); 151 return UseWriteResult(
152 observers, storage->Set(SettingsStorage::DEFAULTS, *input));
152 } 153 }
153 154
154 bool RemoveSettingsFunction::RunWithStorage( 155 bool RemoveSettingsFunction::RunWithStorage(
155 scoped_refptr<SettingsObserverList> observers, 156 scoped_refptr<SettingsObserverList> observers,
156 SettingsStorage* storage) { 157 SettingsStorage* storage) {
157 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 158 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
158 Value *input; 159 Value *input;
159 EXTENSION_FUNCTION_VALIDATE(args_->Get(0, &input)); 160 EXTENSION_FUNCTION_VALIDATE(args_->Get(0, &input));
160 161
161 switch (input->GetType()) { 162 switch (input->GetType()) {
(...skipping 17 matching lines...) Expand all
179 } 180 }
180 181
181 bool ClearSettingsFunction::RunWithStorage( 182 bool ClearSettingsFunction::RunWithStorage(
182 scoped_refptr<SettingsObserverList> observers, 183 scoped_refptr<SettingsObserverList> observers,
183 SettingsStorage* storage) { 184 SettingsStorage* storage) {
184 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 185 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
185 return UseWriteResult(observers, storage->Clear()); 186 return UseWriteResult(observers, storage->Clear());
186 } 187 }
187 188
188 } // namespace extensions 189 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698