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

Side by Side Diff: chrome/browser/extensions/extension_settings_api.cc

Issue 7775008: Enable sync for the settings from the Extension Settings API. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Reordering Created 9 years, 3 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/values.h" 6 #include "base/values.h"
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/extensions/extension_settings_api.h" 8 #include "chrome/browser/extensions/extension_settings_api.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 10
(...skipping 25 matching lines...) Expand all
36 36
37 // SettingsFunction 37 // SettingsFunction
38 38
39 bool SettingsFunction::RunImpl() { 39 bool SettingsFunction::RunImpl() {
40 profile()->GetExtensionService()->extension_settings()->GetStorage( 40 profile()->GetExtensionService()->extension_settings()->GetStorage(
41 extension_id(), 41 extension_id(),
42 base::Bind(&SettingsFunction::RunWithStorage, this)); 42 base::Bind(&SettingsFunction::RunWithStorage, this));
43 return true; 43 return true;
44 } 44 }
45 45
46 void SettingsFunction::RunWithStorage(ExtensionSettingsStorage* storage) { 46 void SettingsFunction::RunWithStorage(
47 SyncableExtensionSettingsStorage* storage) {
47 // Mimic how RunImpl() is handled in extensions code. 48 // Mimic how RunImpl() is handled in extensions code.
48 if (!RunWithStorageImpl(storage)) { 49 if (!RunWithStorageImpl(storage)) {
49 SendResponse(false); 50 SendResponse(false);
50 } 51 }
51 } 52 }
52 53
53 // Concrete settings functions 54 // Concrete settings functions
54 55
55 bool GetSettingsFunction::RunWithStorageImpl( 56 bool GetSettingsFunction::RunWithStorageImpl(
56 ExtensionSettingsStorage* storage) { 57 ExtensionSettingsStorage* storage) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 99 }
99 100
100 return true; 101 return true;
101 } 102 }
102 103
103 bool ClearSettingsFunction::RunWithStorageImpl( 104 bool ClearSettingsFunction::RunWithStorageImpl(
104 ExtensionSettingsStorage* storage) { 105 ExtensionSettingsStorage* storage) {
105 storage->Clear(new StorageResultCallback(this)); 106 storage->Clear(new StorageResultCallback(this));
106 return true; 107 return true;
107 } 108 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698