OLD | NEW |
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/extension_webstore_private_api.h" | 5 #include "chrome/browser/extensions/extension_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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 void BeginInstallWithManifestFunction::OnWebstoreParseSuccess( | 350 void BeginInstallWithManifestFunction::OnWebstoreParseSuccess( |
351 const std::string& id, | 351 const std::string& id, |
352 const SkBitmap& icon, | 352 const SkBitmap& icon, |
353 DictionaryValue* parsed_manifest) { | 353 DictionaryValue* parsed_manifest) { |
354 CHECK_EQ(id_, id); | 354 CHECK_EQ(id_, id); |
355 CHECK(parsed_manifest); | 355 CHECK(parsed_manifest); |
356 icon_ = icon; | 356 icon_ = icon; |
357 parsed_manifest_.reset(parsed_manifest); | 357 parsed_manifest_.reset(parsed_manifest); |
358 | 358 |
359 std::string error; | 359 std::string error; |
360 dummy_extension_ = ExtensionInstallUI::GetLocalizedExtensionForDisplay( | 360 dummy_extension_ = ExtensionInstallPrompt::GetLocalizedExtensionForDisplay( |
361 parsed_manifest_.get(), id, localized_name_, "", &error); | 361 parsed_manifest_.get(), id, localized_name_, "", &error); |
362 | 362 |
363 if (!dummy_extension_) { | 363 if (!dummy_extension_) { |
364 OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR, | 364 OnWebstoreParseFailure(id_, WebstoreInstallHelper::Delegate::MANIFEST_ERROR, |
365 kInvalidManifestError); | 365 kInvalidManifestError); |
366 return; | 366 return; |
367 } | 367 } |
368 | 368 |
369 install_ui_.reset(new ExtensionInstallUI(profile())); | 369 install_ui_.reset(new ExtensionInstallPrompt(profile())); |
370 install_ui_->ConfirmWebstoreInstall(this, dummy_extension_, &icon_); | 370 install_ui_->ConfirmWebstoreInstall(this, dummy_extension_, &icon_); |
371 // Control flow finishes up in InstallUIProceed or InstallUIAbort. | 371 // Control flow finishes up in InstallUIProceed or InstallUIAbort. |
372 } | 372 } |
373 | 373 |
374 void BeginInstallWithManifestFunction::OnWebstoreParseFailure( | 374 void BeginInstallWithManifestFunction::OnWebstoreParseFailure( |
375 const std::string& id, | 375 const std::string& id, |
376 WebstoreInstallHelper::Delegate::InstallHelperResultCode result_code, | 376 WebstoreInstallHelper::Delegate::InstallHelperResultCode result_code, |
377 const std::string& error_message) { | 377 const std::string& error_message) { |
378 CHECK_EQ(id_, id); | 378 CHECK_EQ(id_, id); |
379 | 379 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 SendResponse(true); | 629 SendResponse(true); |
630 } else { | 630 } else { |
631 // Matched with a Release in OnGpuInfoUpdate. | 631 // Matched with a Release in OnGpuInfoUpdate. |
632 AddRef(); | 632 AddRef(); |
633 | 633 |
634 manager->AddObserver(this); | 634 manager->AddObserver(this); |
635 manager->RequestCompleteGpuInfoIfNeeded(); | 635 manager->RequestCompleteGpuInfoIfNeeded(); |
636 } | 636 } |
637 return true; | 637 return true; |
638 } | 638 } |
OLD | NEW |