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

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

Issue 1201063002: Set up the infrastructure for Extension event metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaaaaase Created 5 years, 6 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 29 matching lines...) Expand all
40 // SettingsObserver implementation. 40 // SettingsObserver implementation.
41 void OnSettingsChanged(const std::string& extension_id, 41 void OnSettingsChanged(const std::string& extension_id,
42 settings_namespace::Namespace settings_namespace, 42 settings_namespace::Namespace settings_namespace,
43 const std::string& change_json) override { 43 const std::string& change_json) override {
44 // TODO(gdk): This is a temporary hack while the refactoring for 44 // TODO(gdk): This is a temporary hack while the refactoring for
45 // string-based event payloads is removed. http://crbug.com/136045 45 // string-based event payloads is removed. http://crbug.com/136045
46 scoped_ptr<base::ListValue> args(new base::ListValue()); 46 scoped_ptr<base::ListValue> args(new base::ListValue());
47 args->Append(base::JSONReader::Read(change_json)); 47 args->Append(base::JSONReader::Read(change_json));
48 args->Append(new base::StringValue(settings_namespace::ToString( 48 args->Append(new base::StringValue(settings_namespace::ToString(
49 settings_namespace))); 49 settings_namespace)));
50 scoped_ptr<Event> event(new Event( 50 scoped_ptr<Event> event(new Event(events::UNKNOWN,
51 core_api::storage::OnChanged::kEventName, args.Pass())); 51 core_api::storage::OnChanged::kEventName,
52 args.Pass()));
52 EventRouter::Get(browser_context_) 53 EventRouter::Get(browser_context_)
53 ->DispatchEventToExtension(extension_id, event.Pass()); 54 ->DispatchEventToExtension(extension_id, event.Pass());
54 } 55 }
55 56
56 private: 57 private:
57 BrowserContext* const browser_context_; 58 BrowserContext* const browser_context_;
58 }; 59 };
59 60
60 } // namespace 61 } // namespace
61 62
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // static 177 // static
177 BrowserContextKeyedAPIFactory<StorageFrontend>* 178 BrowserContextKeyedAPIFactory<StorageFrontend>*
178 StorageFrontend::GetFactoryInstance() { 179 StorageFrontend::GetFactoryInstance() {
179 return g_factory.Pointer(); 180 return g_factory.Pointer();
180 } 181 }
181 182
182 // static 183 // static
183 const char* StorageFrontend::service_name() { return "StorageFrontend"; } 184 const char* StorageFrontend::service_name() { return "StorageFrontend"; }
184 185
185 } // namespace extensions 186 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc ('k') | extensions/browser/api/usb/usb_event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698