Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / local_discovery / cloud_print_account_manager.h
blob39c54487b65ac422c81c109ecb313be42a3e0a6a
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_CLOUD_PRINT_ACCOUNT_MANAGER_H_
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_CLOUD_PRINT_ACCOUNT_MANAGER_H_
8 #include <string>
9 #include <vector>
11 #include "base/callback.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "chrome/browser/local_discovery/cloud_print_base_api_flow.h"
15 namespace local_discovery {
17 class CloudPrintAccountManager : public CloudPrintBaseApiFlow::Delegate {
18 public:
19 typedef base::Callback<void(
20 const std::vector<std::string>& /*accounts*/,
21 const std::string& /*xsrf_token*/)> AccountsCallback;
23 CloudPrintAccountManager(net::URLRequestContextGetter* request_context,
24 const std::string& cloud_print_url,
25 int token_user_index,
26 const AccountsCallback& callback);
27 virtual ~CloudPrintAccountManager();
29 void Start();
31 // BaseCloudPrintApiFlow::Delegate implementation.
32 virtual void OnCloudPrintAPIFlowError(
33 CloudPrintBaseApiFlow* flow,
34 CloudPrintBaseApiFlow::Status status) OVERRIDE;
36 virtual void OnCloudPrintAPIFlowComplete(
37 CloudPrintBaseApiFlow* flow,
38 const base::DictionaryValue* value) OVERRIDE;
40 private:
41 void ReportEmptyUserList();
43 CloudPrintBaseApiFlow flow_;
44 AccountsCallback callback_;
47 } // namespace local_discovery
49 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_CLOUD_PRINT_ACCOUNT_MANAGER_H_