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

Side by Side Diff: extensions/browser/api/hid/hid_device_manager.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/hid/hid_device_manager.h" 5 #include "extensions/browser/api/hid/hid_device_manager.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 scoped_ptr<base::ListValue> devices = 311 scoped_ptr<base::ListValue> devices =
312 CreateApiDeviceList(params->extension, params->filters); 312 CreateApiDeviceList(params->extension, params->filters);
313 params->callback.Run(devices.Pass()); 313 params->callback.Run(devices.Pass());
314 } 314 }
315 pending_enumerations_.clear(); 315 pending_enumerations_.clear();
316 } 316 }
317 317
318 void HidDeviceManager::DispatchEvent(const std::string& event_name, 318 void HidDeviceManager::DispatchEvent(const std::string& event_name,
319 scoped_ptr<base::ListValue> event_args, 319 scoped_ptr<base::ListValue> event_args,
320 scoped_refptr<HidDeviceInfo> device_info) { 320 scoped_refptr<HidDeviceInfo> device_info) {
321 scoped_ptr<Event> event(new Event(event_name, event_args.Pass())); 321 scoped_ptr<Event> event(
322 new Event(events::UNKNOWN, event_name, event_args.Pass()));
322 event->will_dispatch_callback = base::Bind( 323 event->will_dispatch_callback = base::Bind(
323 &WillDispatchDeviceEvent, weak_factory_.GetWeakPtr(), device_info); 324 &WillDispatchDeviceEvent, weak_factory_.GetWeakPtr(), device_info);
324 event_router_->BroadcastEvent(event.Pass()); 325 event_router_->BroadcastEvent(event.Pass());
325 } 326 }
326 327
327 } // namespace extensions 328 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/cast_channel/cast_channel_api.cc ('k') | extensions/browser/api/idle/idle_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698