Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / local_discovery / wifi / credential_getter_win.h
bloba0f2161d0e3d1bd687baff600738d7d385da03ff
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_CREDENTIAL_GETTER_WIN_H_
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_CREDENTIAL_GETTER_WIN_H_
8 #include <string>
10 #include "base/single_thread_task_runner.h"
11 #include "content/public/browser/utility_process_host.h"
12 #include "content/public/browser/utility_process_host_client.h"
14 namespace local_discovery {
15 namespace wifi {
17 class CredentialGetterWin : public content::UtilityProcessHostClient {
18 public:
19 typedef base::Callback<void(bool success, const std::string& key)>
20 CredentialsCallback;
22 CredentialGetterWin();
24 void StartGetCredentials(const std::string& network_guid,
25 const CredentialsCallback& callback);
27 private:
28 ~CredentialGetterWin() override;
30 // UtilityProcessHostClient
31 bool OnMessageReceived(const IPC::Message& message) override;
32 void OnProcessCrashed(int exit_code) override;
33 void OnProcessLaunchFailed() override;
35 // IPC message handlers.
36 void OnGotCredentials(const std::string& key_data, bool success);
38 void StartOnIOThread(const std::string& network_guid);
40 void PostCallback(bool success, const std::string& key_data);
42 CredentialsCallback callback_;
43 scoped_refptr<base::SingleThreadTaskRunner> callback_runner_;
46 } // namespace wifi
47 } // namespace local_discovery
49 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_CREDENTIAL_GETTER_WIN_H_