OLD | NEW |
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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 return; | 296 return; |
297 } | 297 } |
298 | 298 |
299 // A neat way to implement unlimited storage; if the extension has the | 299 // A neat way to implement unlimited storage; if the extension has the |
300 // unlimited storage permission, force through all calls to Set() (in the | 300 // unlimited storage permission, force through all calls to Set() (in the |
301 // same way that writes from sync ignore quota). | 301 // same way that writes from sync ignore quota). |
302 // But only if it's local storage (bad stuff would happen if sync'ed | 302 // But only if it's local storage (bad stuff would happen if sync'ed |
303 // storage is allowed to be unlimited). | 303 // storage is allowed to be unlimited). |
304 bool is_unlimited = | 304 bool is_unlimited = |
305 settings_namespace == settings_namespace::LOCAL && | 305 settings_namespace == settings_namespace::LOCAL && |
306 extension->HasAPIPermission(ExtensionAPIPermission::kUnlimitedStorage); | 306 extension->HasAPIPermission(APIPermission::kUnlimitedStorage); |
307 | 307 |
308 scoped_refptr<BackendWrapper> backend; | 308 scoped_refptr<BackendWrapper> backend; |
309 if (extension->is_app()) { | 309 if (extension->is_app()) { |
310 backend = backends_[settings_namespace].app; | 310 backend = backends_[settings_namespace].app; |
311 } else { | 311 } else { |
312 backend = backends_[settings_namespace].extension; | 312 backend = backends_[settings_namespace].extension; |
313 } | 313 } |
314 | 314 |
315 backend->RunWithBackend( | 315 backend->RunWithBackend( |
316 base::Bind( | 316 base::Bind( |
(...skipping 19 matching lines...) Expand all Loading... |
336 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 336 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
337 return observers_; | 337 return observers_; |
338 } | 338 } |
339 | 339 |
340 // BackendWrappers | 340 // BackendWrappers |
341 | 341 |
342 SettingsFrontend::BackendWrappers::BackendWrappers() {} | 342 SettingsFrontend::BackendWrappers::BackendWrappers() {} |
343 SettingsFrontend::BackendWrappers::~BackendWrappers() {} | 343 SettingsFrontend::BackendWrappers::~BackendWrappers() {} |
344 | 344 |
345 } // namespace extensions | 345 } // namespace extensions |
OLD | NEW |