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

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

Issue 9950046: Implement FeatureProvider for ExtensionAPI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: hate hate hate Created 8 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/browser/extensions/extension_function_dispatcher.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_frontend.h" 5 #include "chrome/browser/extensions/settings/settings_frontend.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "chrome/browser/extensions/extension_event_names.h" 10 #include "chrome/browser/extensions/extension_event_names.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 CHECK(base::StringToSizeT(as_string, &as_integer)); 99 CHECK(base::StringToSizeT(as_string, &as_integer));
100 return as_integer; 100 return as_integer;
101 } 101 }
102 102
103 // Constructs a |Limits| configuration by looking up the QUOTA_BYTES, 103 // Constructs a |Limits| configuration by looking up the QUOTA_BYTES,
104 // QUOTA_BYTES_PER_ITEM, and MAX_ITEMS properties of a storage area defined 104 // QUOTA_BYTES_PER_ITEM, and MAX_ITEMS properties of a storage area defined
105 // in chrome/common/extensions/api/storage.json (via ExtensionAPI). 105 // in chrome/common/extensions/api/storage.json (via ExtensionAPI).
106 SettingsStorageQuotaEnforcer::Limits GetLimitsFromExtensionAPI( 106 SettingsStorageQuotaEnforcer::Limits GetLimitsFromExtensionAPI(
107 const std::string& storage_area_id) { 107 const std::string& storage_area_id) {
108 const DictionaryValue* storage_schema = 108 const DictionaryValue* storage_schema =
109 ExtensionAPI::GetInstance()->GetSchema("storage"); 109 ExtensionAPI::GetSharedInstance()->GetSchema("storage");
110 CHECK(storage_schema); 110 CHECK(storage_schema);
111 111
112 DictionaryValue* properties = NULL; 112 DictionaryValue* properties = NULL;
113 storage_schema->GetDictionary( 113 storage_schema->GetDictionary(
114 "properties." + storage_area_id + ".properties", &properties); 114 "properties." + storage_area_id + ".properties", &properties);
115 CHECK(properties); 115 CHECK(properties);
116 116
117 SettingsStorageQuotaEnforcer::Limits limits = { 117 SettingsStorageQuotaEnforcer::Limits limits = {
118 GetStringAsInteger(*properties, "QUOTA_BYTES.value", UINT_MAX), 118 GetStringAsInteger(*properties, "QUOTA_BYTES.value", UINT_MAX),
119 GetStringAsInteger(*properties, "QUOTA_BYTES_PER_ITEM.value", UINT_MAX), 119 GetStringAsInteger(*properties, "QUOTA_BYTES_PER_ITEM.value", UINT_MAX),
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 351 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
352 return observers_; 352 return observers_;
353 } 353 }
354 354
355 // BackendWrappers 355 // BackendWrappers
356 356
357 SettingsFrontend::BackendWrappers::BackendWrappers() {} 357 SettingsFrontend::BackendWrappers::BackendWrappers() {}
358 SettingsFrontend::BackendWrappers::~BackendWrappers() {} 358 SettingsFrontend::BackendWrappers::~BackendWrappers() {}
359 359
360 } // namespace extensions 360 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_function_dispatcher.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698