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

Side by Side Diff: extensions/browser/api/storage/storage_frontend.cc

Issue 664933004: Standardize usage of virtual/override/final in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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/api/storage/storage_frontend.h" 5 #include "extensions/browser/api/storage/storage_frontend.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 18 matching lines...) Expand all
29 LAZY_INSTANCE_INITIALIZER; 29 LAZY_INSTANCE_INITIALIZER;
30 30
31 // Settings change Observer which forwards changes on to the extension 31 // Settings change Observer which forwards changes on to the extension
32 // processes for |context| and its incognito partner if it exists. 32 // processes for |context| and its incognito partner if it exists.
33 class DefaultObserver : public SettingsObserver { 33 class DefaultObserver : public SettingsObserver {
34 public: 34 public:
35 explicit DefaultObserver(BrowserContext* context) 35 explicit DefaultObserver(BrowserContext* context)
36 : browser_context_(context) {} 36 : browser_context_(context) {}
37 37
38 // SettingsObserver implementation. 38 // SettingsObserver implementation.
39 virtual void OnSettingsChanged( 39 void OnSettingsChanged(const std::string& extension_id,
40 const std::string& extension_id, 40 settings_namespace::Namespace settings_namespace,
41 settings_namespace::Namespace settings_namespace, 41 const std::string& change_json) override {
42 const std::string& change_json) override {
43 // TODO(gdk): This is a temporary hack while the refactoring for 42 // TODO(gdk): This is a temporary hack while the refactoring for
44 // string-based event payloads is removed. http://crbug.com/136045 43 // string-based event payloads is removed. http://crbug.com/136045
45 scoped_ptr<base::ListValue> args(new base::ListValue()); 44 scoped_ptr<base::ListValue> args(new base::ListValue());
46 args->Append(base::JSONReader::Read(change_json)); 45 args->Append(base::JSONReader::Read(change_json));
47 args->Append(new base::StringValue(settings_namespace::ToString( 46 args->Append(new base::StringValue(settings_namespace::ToString(
48 settings_namespace))); 47 settings_namespace)));
49 scoped_ptr<Event> event(new Event( 48 scoped_ptr<Event> event(new Event(
50 core_api::storage::OnChanged::kEventName, args.Pass())); 49 core_api::storage::OnChanged::kEventName, args.Pass()));
51 EventRouter::Get(browser_context_) 50 EventRouter::Get(browser_context_)
52 ->DispatchEventToExtension(extension_id, event.Pass()); 51 ->DispatchEventToExtension(extension_id, event.Pass());
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // static 171 // static
173 BrowserContextKeyedAPIFactory<StorageFrontend>* 172 BrowserContextKeyedAPIFactory<StorageFrontend>*
174 StorageFrontend::GetFactoryInstance() { 173 StorageFrontend::GetFactoryInstance() {
175 return g_factory.Pointer(); 174 return g_factory.Pointer();
176 } 175 }
177 176
178 // static 177 // static
179 const char* StorageFrontend::service_name() { return "StorageFrontend"; } 178 const char* StorageFrontend::service_name() { return "StorageFrontend"; }
180 179
181 } // namespace extensions 180 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/storage/storage_frontend.h ('k') | extensions/browser/api/storage/weak_unlimited_settings_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698