| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/api/networking_private/networking_private_cr
edentials_getter.h" | 5 #include "chrome/browser/extensions/api/networking_private/networking_private_cr
edentials_getter.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/thread_task_runner_handle.h" |
| 10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
| 11 #include "chrome/common/extensions/api/networking_private/networking_private_cry
pto.h" | 11 #include "chrome/common/extensions/api/networking_private/networking_private_cry
pto.h" |
| 12 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" | 12 #include "chrome/common/extensions/chrome_utility_extensions_messages.h" |
| 13 #include "chrome/grit/generated_resources.h" | 13 #include "chrome/grit/generated_resources.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/utility_process_host.h" | 15 #include "content/public/browser/utility_process_host.h" |
| 16 #include "content/public/browser/utility_process_host_client.h" | 16 #include "content/public/browser/utility_process_host_client.h" |
| 17 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
| 18 | 18 |
| 19 using content::BrowserThread; | 19 using content::BrowserThread; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 callback_.Run("", "Get Credentials Failed"); | 95 callback_.Run("", "Get Credentials Failed"); |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 | 98 |
| 99 void CredentialsGetterHostClient::StartProcessOnIOThread( | 99 void CredentialsGetterHostClient::StartProcessOnIOThread( |
| 100 const std::string& network_guid, | 100 const std::string& network_guid, |
| 101 const NetworkingPrivateCredentialsGetter::CredentialsCallback& callback) { | 101 const NetworkingPrivateCredentialsGetter::CredentialsCallback& callback) { |
| 102 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 102 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 103 callback_ = callback; | 103 callback_ = callback; |
| 104 UtilityProcessHost* host = | 104 UtilityProcessHost* host = |
| 105 UtilityProcessHost::Create(this, base::MessageLoopProxy::current()); | 105 UtilityProcessHost::Create(this, base::ThreadTaskRunnerHandle::Get()); |
| 106 host->SetName(l10n_util::GetStringUTF16( | 106 host->SetName(l10n_util::GetStringUTF16( |
| 107 IDS_UTILITY_PROCESS_WIFI_CREDENTIALS_GETTER_NAME)); | 107 IDS_UTILITY_PROCESS_WIFI_CREDENTIALS_GETTER_NAME)); |
| 108 host->ElevatePrivileges(); | 108 host->ElevatePrivileges(); |
| 109 host->Send(new ChromeUtilityHostMsg_GetWiFiCredentials(network_guid)); | 109 host->Send(new ChromeUtilityHostMsg_GetWiFiCredentials(network_guid)); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace | 112 } // namespace |
| 113 | 113 |
| 114 namespace extensions { | 114 namespace extensions { |
| 115 | 115 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 146 | 146 |
| 147 NetworkingPrivateCredentialsGetterWin:: | 147 NetworkingPrivateCredentialsGetterWin:: |
| 148 ~NetworkingPrivateCredentialsGetterWin() {} | 148 ~NetworkingPrivateCredentialsGetterWin() {} |
| 149 | 149 |
| 150 NetworkingPrivateCredentialsGetter* | 150 NetworkingPrivateCredentialsGetter* |
| 151 NetworkingPrivateCredentialsGetter::Create() { | 151 NetworkingPrivateCredentialsGetter::Create() { |
| 152 return new NetworkingPrivateCredentialsGetterWin(); | 152 return new NetworkingPrivateCredentialsGetterWin(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 } // namespace extensions | 155 } // namespace extensions |
| OLD | NEW |