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

Side by Side Diff: trunk/src/chrome/browser/extensions/api/gcd_private/gcd_private_api.h

Issue 377383008: Revert 282098 "Add function queryForNewLocalDevices to send quer..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | trunk/src/chrome/browser/extensions/api/gcd_private/gcd_private_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 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_
7 7
8 #include "base/memory/linked_ptr.h" 8 #include "base/memory/linked_ptr.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/extensions/chrome_extension_function.h" 10 #include "chrome/browser/extensions/chrome_extension_function.h"
(...skipping 19 matching lines...) Expand all
30 }; 30 };
31 31
32 explicit GcdPrivateAPI(content::BrowserContext* context); 32 explicit GcdPrivateAPI(content::BrowserContext* context);
33 virtual ~GcdPrivateAPI(); 33 virtual ~GcdPrivateAPI();
34 34
35 static void SetGCDApiFlowFactoryForTests(GCDApiFlowFactoryForTests* factory); 35 static void SetGCDApiFlowFactoryForTests(GCDApiFlowFactoryForTests* factory);
36 36
37 // BrowserContextKeyedAPI implementation. 37 // BrowserContextKeyedAPI implementation.
38 static BrowserContextKeyedAPIFactory<GcdPrivateAPI>* GetFactoryInstance(); 38 static BrowserContextKeyedAPIFactory<GcdPrivateAPI>* GetFactoryInstance();
39 39
40 bool QueryForDevices();
41
42 private: 40 private:
43 friend class BrowserContextKeyedAPIFactory<GcdPrivateAPI>; 41 friend class BrowserContextKeyedAPIFactory<GcdPrivateAPI>;
44 42
45 typedef std::map<std::string /* id_string */, 43 typedef std::map<std::string /* id_string */,
46 linked_ptr<api::gcd_private::GCDDevice> > GCDDeviceMap; 44 linked_ptr<api::gcd_private::GCDDevice> > GCDDeviceMap;
47 45
48 // EventRouter::Observer implementation. 46 // EventRouter::Observer implementation.
49 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; 47 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE;
50 virtual void OnListenerRemoved(const EventListenerInfo& details) OVERRIDE; 48 virtual void OnListenerRemoved(const EventListenerInfo& details) OVERRIDE;
51 49
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 91
94 int requests_succeeded_; 92 int requests_succeeded_;
95 int requests_failed_; 93 int requests_failed_;
96 DeviceList devices_; 94 DeviceList devices_;
97 95
98 scoped_ptr<local_discovery::GCDApiFlow> printer_list_; 96 scoped_ptr<local_discovery::GCDApiFlow> printer_list_;
99 scoped_ptr<local_discovery::GCDApiFlow> device_list_; 97 scoped_ptr<local_discovery::GCDApiFlow> device_list_;
100 }; 98 };
101 99
102 class GcdPrivateQueryForNewLocalDevicesFunction 100 class GcdPrivateQueryForNewLocalDevicesFunction
103 : public ChromeSyncExtensionFunction { 101 : public ChromeAsyncExtensionFunction {
104 public: 102 public:
105 DECLARE_EXTENSION_FUNCTION("gcdPrivate.queryForNewLocalDevices", 103 DECLARE_EXTENSION_FUNCTION("gcdPrivate.queryForNewLocalDevices",
106 GCDPRIVATE_QUERYFORNEWLOCALDEVICES) 104 GCDPRIVATE_QUERYFORNEWLOCALDEVICES)
107 105
108 GcdPrivateQueryForNewLocalDevicesFunction(); 106 GcdPrivateQueryForNewLocalDevicesFunction();
109 107
110 protected: 108 protected:
111 virtual ~GcdPrivateQueryForNewLocalDevicesFunction(); 109 virtual ~GcdPrivateQueryForNewLocalDevicesFunction();
112 110
113 // SyncExtensionFunction overrides. 111 // AsyncExtensionFunction overrides.
114 virtual bool RunSync() OVERRIDE; 112 virtual bool RunAsync() OVERRIDE;
115 }; 113 };
116 114
117 class GcdPrivateStartSetupFunction : public ChromeAsyncExtensionFunction { 115 class GcdPrivateStartSetupFunction : public ChromeAsyncExtensionFunction {
118 public: 116 public:
119 public: 117 public:
120 DECLARE_EXTENSION_FUNCTION("gcdPrivate.startSetup", GCDPRIVATE_STARTSETUP) 118 DECLARE_EXTENSION_FUNCTION("gcdPrivate.startSetup", GCDPRIVATE_STARTSETUP)
121 119
122 GcdPrivateStartSetupFunction(); 120 GcdPrivateStartSetupFunction();
123 121
124 protected: 122 protected:
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 187
190 // AsyncExtensionFunction overrides. 188 // AsyncExtensionFunction overrides.
191 virtual bool RunAsync() OVERRIDE; 189 virtual bool RunAsync() OVERRIDE;
192 190
193 private: 191 private:
194 }; 192 };
195 193
196 } // namespace extensions 194 } // namespace extensions
197 195
198 #endif // CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_ 196 #endif // CHROME_BROWSER_EXTENSIONS_API_GCD_PRIVATE_GCD_PRIVATE_API_H_
OLDNEW
« no previous file with comments | « no previous file | trunk/src/chrome/browser/extensions/api/gcd_private/gcd_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698