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

Side by Side Diff: chrome/browser/extensions/api/gcd_private/gcd_private_api.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 "chrome/browser/extensions/api/gcd_private/gcd_private_api.h" 5 #include "chrome/browser/extensions/api/gcd_private/gcd_private_api.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/linked_ptr.h" 9 #include "base/memory/linked_ptr.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 const char kPrivetKeyWifi[] = "wifi"; 50 const char kPrivetKeyWifi[] = "wifi";
51 const char kPrivetKeyPassphrase[] = "passphrase"; 51 const char kPrivetKeyPassphrase[] = "passphrase";
52 const char kPrivetKeySSID[] = "ssid"; 52 const char kPrivetKeySSID[] = "ssid";
53 const char kPrivetKeyPassphraseDotted[] = "wifi.passphrase"; 53 const char kPrivetKeyPassphraseDotted[] = "wifi.passphrase";
54 54
55 scoped_ptr<Event> MakeDeviceStateChangedEvent( 55 scoped_ptr<Event> MakeDeviceStateChangedEvent(
56 const gcd_private::GCDDevice& device) { 56 const gcd_private::GCDDevice& device) {
57 scoped_ptr<base::ListValue> params = 57 scoped_ptr<base::ListValue> params =
58 gcd_private::OnDeviceStateChanged::Create(device); 58 gcd_private::OnDeviceStateChanged::Create(device);
59 scoped_ptr<Event> event( 59 scoped_ptr<Event> event(
60 new Event(gcd_private::OnDeviceStateChanged::kEventName, params.Pass())); 60 new Event(events::UNKNOWN, gcd_private::OnDeviceStateChanged::kEventName,
61 params.Pass()));
61 return event.Pass(); 62 return event.Pass();
62 } 63 }
63 64
64 scoped_ptr<Event> MakeDeviceRemovedEvent(const std::string& device) { 65 scoped_ptr<Event> MakeDeviceRemovedEvent(const std::string& device) {
65 scoped_ptr<base::ListValue> params = 66 scoped_ptr<base::ListValue> params =
66 gcd_private::OnDeviceRemoved::Create(device); 67 gcd_private::OnDeviceRemoved::Create(device);
67 scoped_ptr<Event> event( 68 scoped_ptr<Event> event(new Event(events::UNKNOWN,
68 new Event(gcd_private::OnDeviceRemoved::kEventName, params.Pass())); 69 gcd_private::OnDeviceRemoved::kEventName,
70 params.Pass()));
69 return event.Pass(); 71 return event.Pass();
70 } 72 }
71 73
72 GcdPrivateAPI::GCDApiFlowFactoryForTests* g_gcd_api_flow_factory = NULL; 74 GcdPrivateAPI::GCDApiFlowFactoryForTests* g_gcd_api_flow_factory = NULL;
73 75
74 base::LazyInstance<BrowserContextKeyedAPIFactory<GcdPrivateAPI> > g_factory = 76 base::LazyInstance<BrowserContextKeyedAPIFactory<GcdPrivateAPI> > g_factory =
75 LAZY_INSTANCE_INITIALIZER; 77 LAZY_INSTANCE_INITIALIZER;
76 78
77 scoped_ptr<local_discovery::GCDApiFlow> MakeGCDApiFlow(Profile* profile) { 79 scoped_ptr<local_discovery::GCDApiFlow> MakeGCDApiFlow(Profile* profile) {
78 if (g_gcd_api_flow_factory) { 80 if (g_gcd_api_flow_factory) {
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 } 883 }
882 884
883 GcdPrivateGetCommandsListFunction::~GcdPrivateGetCommandsListFunction() { 885 GcdPrivateGetCommandsListFunction::~GcdPrivateGetCommandsListFunction() {
884 } 886 }
885 887
886 bool GcdPrivateGetCommandsListFunction::RunAsync() { 888 bool GcdPrivateGetCommandsListFunction::RunAsync() {
887 return false; 889 return false;
888 } 890 }
889 891
890 } // namespace extensions 892 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/file_system/file_system_api.cc ('k') | chrome/browser/extensions/api/gcm/gcm_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698