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

Unified Diff: chrome/browser/local_discovery/cloud_device_list.h

Issue 284223004: List cloud devices in chrome://devices page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/local_discovery/cloud_device_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/local_discovery/cloud_device_list.h
diff --git a/chrome/browser/local_discovery/cloud_device_list.h b/chrome/browser/local_discovery/cloud_device_list.h
new file mode 100644
index 0000000000000000000000000000000000000000..86e03216d12fe1ad28e65b775baaa472c42567f7
--- /dev/null
+++ b/chrome/browser/local_discovery/cloud_device_list.h
@@ -0,0 +1,56 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_LOCAL_DISCOVERY_CLOUD_DEVICE_LIST_H_
+#define CHROME_BROWSER_LOCAL_DISCOVERY_CLOUD_DEVICE_LIST_H_
+
+#include <string>
+#include <vector>
+
+#include "chrome/browser/local_discovery/cloud_device_list_delegate.h"
+#include "chrome/browser/local_discovery/gcd_base_api_flow.h"
+
+namespace local_discovery {
+
+class CloudDeviceList : public GCDBaseApiFlow::Delegate {
+ public:
+ typedef std::vector<CloudDeviceListDelegate::Device> DeviceList;
+ typedef DeviceList::const_iterator iterator;
+
+ CloudDeviceList(net::URLRequestContextGetter* request_context,
+ OAuth2TokenService* token_service,
+ const std::string& account_id,
+ CloudDeviceListDelegate* delegate);
+ virtual ~CloudDeviceList();
+
+ void Start();
+
+ virtual void OnGCDAPIFlowError(GCDBaseApiFlow* flow,
+ GCDBaseApiFlow::Status status) OVERRIDE;
+
+ virtual void OnGCDAPIFlowComplete(
+ GCDBaseApiFlow* flow,
+ const base::DictionaryValue* value) OVERRIDE;
+
+ virtual bool GCDIsCloudPrint() OVERRIDE;
+
+ GCDBaseApiFlow* GetOAuth2ApiFlowForTests() { return &api_flow_; }
+
+ const DeviceList& device_list() const {
+ return device_list_;
+ }
+
+ private:
+ bool FillDeviceDetails(const base::DictionaryValue* value,
+ CloudDeviceListDelegate::Device* device);
+
+ scoped_refptr<net::URLRequestContextGetter> request_context_;
+ DeviceList device_list_;
+ CloudDeviceListDelegate* delegate_;
+ GCDBaseApiFlow api_flow_;
+};
+
+} // namespace local_discovery
+
+#endif // CHROME_BROWSER_LOCAL_DISCOVERY_CLOUD_DEVICE_LIST_H_
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/local_discovery/cloud_device_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698