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

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

Issue 12208040: [win] Add a progress bar in the app launcher for app installs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linux compile Created 7 years, 10 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"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 UpdateIsAppLauncherEnabled(base::Bind( 461 UpdateIsAppLauncherEnabled(base::Bind(
462 &CompleteInstallFunction::OnGetAppLauncherEnabled, this, 462 &CompleteInstallFunction::OnGetAppLauncherEnabled, this,
463 approval_->extension_id)); 463 approval_->extension_id));
464 } 464 }
465 465
466 void CompleteInstallFunction::OnGetAppLauncherEnabled( 466 void CompleteInstallFunction::OnGetAppLauncherEnabled(
467 std::string id, 467 std::string id,
468 bool app_launcher_enabled) { 468 bool app_launcher_enabled) {
469 if (app_launcher_enabled) { 469 if (app_launcher_enabled) {
470 std::string name; 470 std::string name;
471 DCHECK(approval_->parsed_manifest->GetString(extension_manifest_keys::kName,
472 &name));
473 #if defined(ENABLE_APP_LIST) 471 #if defined(ENABLE_APP_LIST)
472 if (!approval_->parsed_manifest->GetString(extension_manifest_keys::kName,
473 &name)) {
474 NOTREACHED();
475 }
474 // Tell the app list about the install that we just started. 476 // Tell the app list about the install that we just started.
475 chrome::NotifyAppListOfBeginExtensionInstall( 477 chrome::NotifyAppListOfBeginExtensionInstall(
476 profile(), id, name, approval_->installing_icon); 478 profile(), id, name, approval_->installing_icon);
477 #endif 479 #endif
478 } 480 }
479 481
480 // The extension will install through the normal extension install flow, but 482 // The extension will install through the normal extension install flow, but
481 // the whitelist entry will bypass the normal permissions install dialog. 483 // the whitelist entry will bypass the normal permissions install dialog.
482 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller( 484 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller(
483 profile(), this, 485 profile(), this,
(...skipping 22 matching lines...) Expand all
506 id, error, reason); 508 id, error, reason);
507 } 509 }
508 510
509 error_ = error; 511 error_ = error;
510 SendResponse(false); 512 SendResponse(false);
511 513
512 // Matches the AddRef in RunImpl(). 514 // Matches the AddRef in RunImpl().
513 Release(); 515 Release();
514 } 516 }
515 517
518 void CompleteInstallFunction::OnExtensionDownloadProgress(
519 const std::string& id,
520 content::DownloadItem* item) {
521 #if defined(ENABLE_APP_LIST)
522 chrome::NotifyAppListOfDownloadProgress(profile(), id,
523 item->PercentComplete());
524 #endif
525 }
516 526
517 bool GetBrowserLoginFunction::RunImpl() { 527 bool GetBrowserLoginFunction::RunImpl() {
518 SetResult(CreateLoginResult(profile_->GetOriginalProfile())); 528 SetResult(CreateLoginResult(profile_->GetOriginalProfile()));
519 return true; 529 return true;
520 } 530 }
521 531
522 bool GetStoreLoginFunction::RunImpl() { 532 bool GetStoreLoginFunction::RunImpl() {
523 ExtensionService* service = 533 ExtensionService* service =
524 extensions::ExtensionSystem::Get(profile_)->extension_service(); 534 extensions::ExtensionSystem::Get(profile_)->extension_service();
525 ExtensionPrefs* prefs = service->extension_prefs(); 535 ExtensionPrefs* prefs = service->extension_prefs();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 &GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted, this)); 581 &GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted, this));
572 return true; 582 return true;
573 } 583 }
574 584
575 void GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted(bool is_enabled) { 585 void GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted(bool is_enabled) {
576 SetResult(Value::CreateBooleanValue(is_enabled)); 586 SetResult(Value::CreateBooleanValue(is_enabled));
577 SendResponse(true); 587 SendResponse(true);
578 } 588 }
579 589
580 } // namespace extensions 590 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/webstore_private/webstore_private_api.h ('k') | chrome/browser/ui/app_list/app_list_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698