OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/dashboard_private/dashboard_private_api.
h" | 5 #include "chrome/browser/extensions/api/dashboard_private/dashboard_private_api.
h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
9 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" | 11 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" |
10 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
11 #include "components/crx_file/id_util.h" | 13 #include "components/crx_file/id_util.h" |
12 #include "extensions/common/extension.h" | 14 #include "extensions/common/extension.h" |
13 #include "net/base/load_flags.h" | 15 #include "net/base/load_flags.h" |
14 #include "net/url_request/url_request.h" | 16 #include "net/url_request/url_request.h" |
15 #include "url/gurl.h" | 17 #include "url/gurl.h" |
16 | 18 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 Release(); | 140 Release(); |
139 return; | 141 return; |
140 } | 142 } |
141 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt( | 143 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt( |
142 new ExtensionInstallPrompt::Prompt( | 144 new ExtensionInstallPrompt::Prompt( |
143 ExtensionInstallPrompt::DELEGATED_PERMISSIONS_PROMPT)); | 145 ExtensionInstallPrompt::DELEGATED_PERMISSIONS_PROMPT)); |
144 prompt->set_delegated_username(details().delegated_user); | 146 prompt->set_delegated_username(details().delegated_user); |
145 | 147 |
146 install_prompt_.reset(new ExtensionInstallPrompt(web_contents)); | 148 install_prompt_.reset(new ExtensionInstallPrompt(web_contents)); |
147 install_prompt_->ShowDialog( | 149 install_prompt_->ShowDialog( |
148 this, dummy_extension_.get(), &icon, prompt.Pass(), | 150 this, dummy_extension_.get(), &icon, std::move(prompt), |
149 ExtensionInstallPrompt::GetDefaultShowDialogCallback()); | 151 ExtensionInstallPrompt::GetDefaultShowDialogCallback()); |
150 // Control flow finishes up in InstallUIProceed or InstallUIAbort. | 152 // Control flow finishes up in InstallUIProceed or InstallUIAbort. |
151 } | 153 } |
152 | 154 |
153 void DashboardPrivateShowPermissionPromptForDelegatedInstallFunction:: | 155 void DashboardPrivateShowPermissionPromptForDelegatedInstallFunction:: |
154 OnWebstoreParseFailure( | 156 OnWebstoreParseFailure( |
155 const std::string& id, | 157 const std::string& id, |
156 WebstoreInstallHelper::Delegate::InstallHelperResultCode result, | 158 WebstoreInstallHelper::Delegate::InstallHelperResultCode result, |
157 const std::string& error_message) { | 159 const std::string& error_message) { |
158 CHECK_EQ(params_->details.id, id); | 160 CHECK_EQ(params_->details.id, id); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 ? kUserCancelledError | 282 ? kUserCancelledError |
281 : kInvalidBundleError)); | 283 : kInvalidBundleError)); |
282 return; | 284 return; |
283 } | 285 } |
284 | 286 |
285 Respond(NoArguments()); | 287 Respond(NoArguments()); |
286 } | 288 } |
287 | 289 |
288 } // namespace extensions | 290 } // namespace extensions |
289 | 291 |
OLD | NEW |