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

Side by Side Diff: chrome/browser/extensions/api/api_resource_event_notifier.cc

Issue 10696208: Move ExtensionEventRouter and related into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed bug + latest master Created 8 years, 5 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 (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/api/api_resource_event_notifier.h" 5 #include "chrome/browser/extensions/api/api_resource_event_notifier.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/extensions/extension_event_router.h" 10 #include "chrome/browser/extensions/event_router.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 13
14 using content::BrowserThread; 14 using content::BrowserThread;
15 15
16 namespace events { 16 namespace events {
17 const char kExperimentalSocketOnEvent[] = "experimental.socket.onEvent"; 17 const char kExperimentalSocketOnEvent[] = "experimental.socket.onEvent";
18 const char kExperimentalUsbOnEvent[] = "experimental.usb.onEvent"; 18 const char kExperimentalUsbOnEvent[] = "experimental.usb.onEvent";
19 }; 19 };
20 20
(...skipping 10 matching lines...) Expand all
31 const char kSrcIdKey[] = "srcId"; 31 const char kSrcIdKey[] = "srcId";
32 const char kIsFinalEventKey[] = "isFinalEvent"; 32 const char kIsFinalEventKey[] = "isFinalEvent";
33 33
34 const char kResultCodeKey[] = "resultCode"; 34 const char kResultCodeKey[] = "resultCode";
35 const char kDataKey[] = "data"; 35 const char kDataKey[] = "data";
36 const char kAddressKey[] = "address"; 36 const char kAddressKey[] = "address";
37 const char kPortKey[] = "port"; 37 const char kPortKey[] = "port";
38 const char kErrorKey[] = "error"; 38 const char kErrorKey[] = "error";
39 39
40 ApiResourceEventNotifier::ApiResourceEventNotifier( 40 ApiResourceEventNotifier::ApiResourceEventNotifier(
41 ExtensionEventRouter* router, 41 EventRouter* router,
42 Profile* profile, 42 Profile* profile,
43 const std::string& src_extension_id, 43 const std::string& src_extension_id,
44 int src_id, 44 int src_id,
45 const GURL& src_url) 45 const GURL& src_url)
46 : router_(router), 46 : router_(router),
47 profile_(profile), 47 profile_(profile),
48 src_extension_id_(src_extension_id), 48 src_extension_id_(src_extension_id),
49 src_id_(src_id), 49 src_id_(src_id),
50 src_url_(src_url) { 50 src_url_(src_url) {
51 } 51 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 int result_code) { 161 int result_code) {
162 if (src_id_ < 0) 162 if (src_id_ < 0)
163 return; 163 return;
164 164
165 DictionaryValue* event = CreateApiResourceEvent(event_type); 165 DictionaryValue* event = CreateApiResourceEvent(event_type);
166 event->SetInteger(kResultCodeKey, result_code); 166 event->SetInteger(kResultCodeKey, result_code);
167 DispatchEvent(extension, event); 167 DispatchEvent(extension, event);
168 } 168 }
169 169
170 } // namespace extensions 170 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/api_resource_event_notifier.h ('k') | chrome/browser/extensions/api/app/app_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698