Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.cc

Issue 11087071: Making ShowExtensionInstallDialog a callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/webstore_private/webstore_private_api.h" 5 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/extensions/crx_installer.h" 15 #include "chrome/browser/extensions/crx_installer.h"
16 #include "chrome/browser/extensions/extension_function_dispatcher.h" 16 #include "chrome/browser/extensions/extension_function_dispatcher.h"
17 #include "chrome/browser/extensions/extension_install_dialog.h"
18 #include "chrome/browser/extensions/extension_prefs.h" 17 #include "chrome/browser/extensions/extension_prefs.h"
19 #include "chrome/browser/extensions/extension_service.h" 18 #include "chrome/browser/extensions/extension_service.h"
20 #include "chrome/browser/extensions/webstore_installer.h" 19 #include "chrome/browser/extensions/webstore_installer.h"
21 #include "chrome/browser/prefs/pref_service.h" 20 #include "chrome/browser/prefs/pref_service.h"
22 #include "chrome/browser/profiles/profile_manager.h" 21 #include "chrome/browser/profiles/profile_manager.h"
23 #include "chrome/browser/signin/token_service.h" 22 #include "chrome/browser/signin/token_service.h"
24 #include "chrome/browser/signin/token_service_factory.h" 23 #include "chrome/browser/signin/token_service_factory.h"
25 #include "chrome/browser/sync/profile_sync_service.h" 24 #include "chrome/browser/sync/profile_sync_service.h"
26 #include "chrome/browser/sync/profile_sync_service_factory.h" 25 #include "chrome/browser/sync/profile_sync_service_factory.h"
27 #include "chrome/common/chrome_notification_types.h" 26 #include "chrome/common/chrome_notification_types.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 &error); 317 &error);
319 318
320 if (!dummy_extension_) { 319 if (!dummy_extension_) {
321 OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR, 320 OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR,
322 kInvalidManifestError); 321 kInvalidManifestError);
323 return; 322 return;
324 } 323 }
325 324
326 install_prompt_.reset( 325 install_prompt_.reset(
327 chrome::CreateExtensionInstallPromptWithBrowser(GetCurrentBrowser())); 326 chrome::CreateExtensionInstallPromptWithBrowser(GetCurrentBrowser()));
328 install_prompt_->ConfirmWebstoreInstall(this, dummy_extension_, &icon_); 327 install_prompt_->ConfirmWebstoreInstall(
328 this,
329 dummy_extension_,
330 &icon_,
331 ExtensionInstallPrompt::ShowDialogCallback());
Aaron Boodman 2012/10/11 20:28:50 This is super confusing. I thought this was a func
sail 2012/10/11 21:18:47 Changed to ExtensionInstallPrompt::GetDefaultShowD
329 // Control flow finishes up in InstallUIProceed or InstallUIAbort. 332 // Control flow finishes up in InstallUIProceed or InstallUIAbort.
330 } 333 }
331 334
332 void BeginInstallWithManifestFunction::OnWebstoreParseFailure( 335 void BeginInstallWithManifestFunction::OnWebstoreParseFailure(
333 const std::string& id, 336 const std::string& id,
334 WebstoreInstallHelper::Delegate::InstallHelperResultCode result_code, 337 WebstoreInstallHelper::Delegate::InstallHelperResultCode result_code,
335 const std::string& error_message) { 338 const std::string& error_message) {
336 CHECK_EQ(id_, id); 339 CHECK_EQ(id_, id);
337 340
338 // Map from WebstoreInstallHelper's result codes to ours. 341 // Map from WebstoreInstallHelper's result codes to ours.
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 feature_checker_->CheckGPUFeatureAvailability(); 508 feature_checker_->CheckGPUFeatureAvailability();
506 return true; 509 return true;
507 } 510 }
508 511
509 void GetWebGLStatusFunction::OnFeatureCheck(bool feature_allowed) { 512 void GetWebGLStatusFunction::OnFeatureCheck(bool feature_allowed) {
510 CreateResult(feature_allowed); 513 CreateResult(feature_allowed);
511 SendResponse(true); 514 SendResponse(true);
512 } 515 }
513 516
514 } // namespace extensions 517 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698