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

Unified Diff: chrome/browser/extensions/api/gcd_private/gcd_private_api.cc

Issue 356613002: Add queryForNewLocalDevices to gcdPrivate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/gcd_private/gcd_private_api.cc
diff --git a/chrome/browser/extensions/api/gcd_private/gcd_private_api.cc b/chrome/browser/extensions/api/gcd_private/gcd_private_api.cc
index 08c1abefec5c75677136b0a7f788efb2c674ce37..5d79794ef217b8d393f131c7006a256e184160ab 100644
--- a/chrome/browser/extensions/api/gcd_private/gcd_private_api.cc
+++ b/chrome/browser/extensions/api/gcd_private/gcd_private_api.cc
@@ -154,6 +154,15 @@ void GcdPrivateAPI::DeviceCacheFlushed() {
known_devices_.clear();
}
+bool GcdPrivateAPI::QueryForDevices() {
+ if (!privet_device_lister_)
+ return false;
+
+ privet_device_lister_->DiscoverNewDevices(true);
+
+ return true;
+}
+
// static
void GcdPrivateAPI::SetGCDApiFlowFactoryForTests(
GCDApiFlowFactoryForTests* factory) {
@@ -235,6 +244,30 @@ void GcdPrivateGetCloudDeviceListFunction::CheckListingDone() {
Release();
}
+GcdPrivateQueryForNewLocalDevicesFunction::
+ GcdPrivateQueryForNewLocalDevicesFunction() {
+}
+
+GcdPrivateQueryForNewLocalDevicesFunction::
+ ~GcdPrivateQueryForNewLocalDevicesFunction() {
+}
+
+bool GcdPrivateQueryForNewLocalDevicesFunction::RunSync() {
+ GcdPrivateAPI* gcd_api =
+ BrowserContextKeyedAPIFactory<GcdPrivateAPI>::Get(GetProfile());
+
+ if (!gcd_api)
+ return false;
+
+ if (!gcd_api->QueryForDevices()) {
+ error_ =
+ "You must first subscribe to onCloudDeviceStateChanged notifications";
Vitaly Buka (NO REVIEWS) 2014/07/09 04:34:09 please update this
+ return false;
+ }
+
+ return true;
+}
+
GcdPrivateStartSetupFunction::GcdPrivateStartSetupFunction() {
}

Powered by Google App Engine
This is Rietveld 408576698