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

Side by Side Diff: extensions/browser/api/serial/serial_event_dispatcher.cc

Issue 1226353004: Generate all extension schema namespaces as "api" and instead vary the generated bundle names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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/serial/serial_event_dispatcher.h" 5 #include "extensions/browser/api/serial/serial_event_dispatcher.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "extensions/browser/api/serial/serial_connection.h" 8 #include "extensions/browser/api/serial/serial_connection.h"
9 #include "extensions/browser/event_router.h" 9 #include "extensions/browser/event_router.h"
10 #include "extensions/browser/extensions_browser_client.h" 10 #include "extensions/browser/extensions_browser_client.h"
11 11
12 namespace extensions { 12 namespace extensions {
13 13
14 namespace core_api { 14 namespace api {
15 15
16 namespace { 16 namespace {
17 17
18 bool ShouldPauseOnReceiveError(serial::ReceiveError error) { 18 bool ShouldPauseOnReceiveError(serial::ReceiveError error) {
19 return error == serial::RECEIVE_ERROR_DEVICE_LOST || 19 return error == serial::RECEIVE_ERROR_DEVICE_LOST ||
20 error == serial::RECEIVE_ERROR_SYSTEM_ERROR || 20 error == serial::RECEIVE_ERROR_SYSTEM_ERROR ||
21 error == serial::RECEIVE_ERROR_DISCONNECTED; 21 error == serial::RECEIVE_ERROR_DISCONNECTED;
22 } 22 }
23 23
24 } // namespace 24 } // namespace
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 content::BrowserContext* context = 149 content::BrowserContext* context =
150 reinterpret_cast<content::BrowserContext*>(browser_context_id); 150 reinterpret_cast<content::BrowserContext*>(browser_context_id);
151 if (!extensions::ExtensionsBrowserClient::Get()->IsValidContext(context)) 151 if (!extensions::ExtensionsBrowserClient::Get()->IsValidContext(context))
152 return; 152 return;
153 153
154 EventRouter* router = EventRouter::Get(context); 154 EventRouter* router = EventRouter::Get(context);
155 if (router) 155 if (router)
156 router->DispatchEventToExtension(extension_id, event.Pass()); 156 router->DispatchEventToExtension(extension_id, event.Pass());
157 } 157 }
158 158
159 } // namespace core_api 159 } // namespace api
160 160
161 } // namespace extensions 161 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698