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_
10 #include "base/message_loop/message_loop_proxy.h"
11 #include "content/public/browser/utility_process_host.h"
12 #include "content/public/browser/utility_process_host_client.h"
14 namespace local_discovery
{
17 class CredentialGetterWin
: public content::UtilityProcessHostClient
{
19 typedef base::Callback
<void(bool success
, const std::string
& key
)>
22 CredentialGetterWin();
23 virtual ~CredentialGetterWin();
25 void StartGetCredentials(const std::string
& network_guid
,
26 const CredentialsCallback
& callback
);
29 // UtilityProcessHostClient
30 virtual bool OnMessageReceived(const IPC::Message
& message
) OVERRIDE
;
31 virtual void OnProcessCrashed(int exit_code
) OVERRIDE
;
32 virtual void OnProcessLaunchFailed() OVERRIDE
;
34 // IPC message handlers.
35 void OnGotCredentials(const std::string
& key_data
, bool success
);
37 void StartOnIOThread(const std::string
& network_guid
);
39 void PostCallback(bool success
, const std::string
& key_data
);
41 CredentialsCallback callback_
;
42 scoped_refptr
<base::MessageLoopProxy
> callback_runner_
;
46 } // namespace local_discovery
48 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_CREDENTIAL_GETTER_WIN_H_