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

Side by Side Diff: chrome/browser/extensions/api/dial/dial_api.h

Issue 2602593002: [chrome.dial] [WIP] Adds an API to get the active network ID. (Closed)
Patch Set: Outline API Created 3 years, 11 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
« no previous file with comments | « chrome/browser/extensions/BUILD.gn ('k') | chrome/browser/extensions/api/dial/dial_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "chrome/browser/extensions/api/dial/dial_device_data.h" 11 #include "chrome/browser/extensions/api/dial/dial_device_data.h"
12 #include "chrome/browser/extensions/api/dial/dial_registry.h" 12 #include "chrome/browser/extensions/api/dial/dial_registry.h"
13 #include "chrome/browser/extensions/api/dial/discovery_network_monitor.h"
13 #include "components/keyed_service/core/refcounted_keyed_service.h" 14 #include "components/keyed_service/core/refcounted_keyed_service.h"
14 #include "extensions/browser/api/async_api_function.h" 15 #include "extensions/browser/api/async_api_function.h"
15 #include "extensions/browser/event_router.h" 16 #include "extensions/browser/event_router.h"
16 17
17 namespace extensions { 18 namespace extensions {
18 19
19 class DialRegistry; 20 class DialRegistry;
20 21
21 // Dial API which is a ref-counted KeyedService that manages 22 // Dial API which is a ref-counted KeyedService that manages
22 // the DIAL registry. It takes care of creating the registry on the IO thread 23 // the DIAL registry. It takes care of creating the registry on the IO thread
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 DialAPI* dial_; 94 DialAPI* dial_;
94 95
95 // Result of the discoverNow call to the DIAL registry. This result is 96 // Result of the discoverNow call to the DIAL registry. This result is
96 // retrieved on the IO thread but the function result is returned on the UI 97 // retrieved on the IO thread but the function result is returned on the UI
97 // thread. 98 // thread.
98 bool result_; 99 bool result_;
99 100
100 DISALLOW_COPY_AND_ASSIGN(DialDiscoverNowFunction); 101 DISALLOW_COPY_AND_ASSIGN(DialDiscoverNowFunction);
101 }; 102 };
102 103
104 class DialGetNetworkIdFunction : public AsyncApiFunction {
105 public:
106 DialGetNetworkIdFunction() = default;
107
108 protected:
109 ~DialGetNetworkIdFunction() override = default;
110
111 // AsyncApiFunction:
112 bool Prepare() override;
113 void Work() override;
114 bool Respond() override;
115
116 private:
117 DECLARE_EXTENSION_FUNCTION("dial.getNetworkId", DIAL_GETNETWORKID);
118
119 DISALLOW_COPY_AND_ASSIGN(DialGetNetworkIdFunction);
120 };
121
103 } // namespace api 122 } // namespace api
104 123
105 } // namespace extensions 124 } // namespace extensions
106 125
107 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_H_ 126 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/BUILD.gn ('k') | chrome/browser/extensions/api/dial/dial_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698