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_
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
{
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
,
26 const AccountsCallback
& callback
);
27 virtual ~CloudPrintAccountManager();
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
;
41 void ReportEmptyUserList();
43 CloudPrintBaseApiFlow flow_
;
44 AccountsCallback callback_
;
47 } // namespace local_discovery
49 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_CLOUD_PRINT_ACCOUNT_MANAGER_H_