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

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

Issue 10388252: Refactoring ExtenionInstallUI to abstract the Browser references. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced + mac fix Created 8 years, 6 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/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 void BeginInstallWithManifestFunction::OnWebstoreParseSuccess( 351 void BeginInstallWithManifestFunction::OnWebstoreParseSuccess(
352 const std::string& id, 352 const std::string& id,
353 const SkBitmap& icon, 353 const SkBitmap& icon,
354 DictionaryValue* parsed_manifest) { 354 DictionaryValue* parsed_manifest) {
355 CHECK_EQ(id_, id); 355 CHECK_EQ(id_, id);
356 CHECK(parsed_manifest); 356 CHECK(parsed_manifest);
357 icon_ = icon; 357 icon_ = icon;
358 parsed_manifest_.reset(parsed_manifest); 358 parsed_manifest_.reset(parsed_manifest);
359 359
360 std::string error; 360 std::string error;
361 dummy_extension_ = ExtensionInstallUI::GetLocalizedExtensionForDisplay( 361 dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay(
362 parsed_manifest_.get(), id, localized_name_, "", &error); 362 parsed_manifest_.get(), id, localized_name_, "", &error);
363 363
364 if (!dummy_extension_) { 364 if (!dummy_extension_) {
365 OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR, 365 OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR,
366 kInvalidManifestError); 366 kInvalidManifestError);
367 return; 367 return;
368 } 368 }
369 369
370 install_ui_.reset(new ExtensionInstallUI(profile())); 370 install_prompt_.reset(new ExtensionInstallPrompt(profile()));
371 install_ui_->ConfirmWebstoreInstall(this, dummy_extension_, &icon_); 371 install_prompt_->ConfirmWebstoreInstall(this, dummy_extension_, &icon_);
372 // Control flow finishes up in InstallUIProceed or InstallUIAbort. 372 // Control flow finishes up in InstallUIProceed or InstallUIAbort.
373 } 373 }
374 374
375 void BeginInstallWithManifestFunction::OnWebstoreParseFailure( 375 void BeginInstallWithManifestFunction::OnWebstoreParseFailure(
376 const std::string& id, 376 const std::string& id,
377 WebstoreInstallHelper::Delegate::InstallHelperResultCode result_code, 377 WebstoreInstallHelper::Delegate::InstallHelperResultCode result_code,
378 const std::string& error_message) { 378 const std::string& error_message) {
379 CHECK_EQ(id_, id); 379 CHECK_EQ(id_, id);
380 380
381 // Map from WebstoreInstallHelper's result codes to ours. 381 // Map from WebstoreInstallHelper's result codes to ours.
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 // Matched with a Release in OnGpuInfoUpdate. 632 // Matched with a Release in OnGpuInfoUpdate.
633 AddRef(); 633 AddRef();
634 634
635 manager->AddObserver(this); 635 manager->AddObserver(this);
636 manager->RequestCompleteGpuInfoIfNeeded(); 636 manager->RequestCompleteGpuInfoIfNeeded();
637 } 637 }
638 return true; 638 return true;
639 } 639 }
640 640
641 } // namespace extensions 641 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698