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

Side by Side Diff: chrome/browser/extensions/webstore_installer.cc

Issue 1281313003: base: Remove using:: declaration from version.h header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more fixes Created 5 years, 4 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
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/webstore_installer.h" 5 #include "chrome/browser/extensions/webstore_installer.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 download_item_->RemoveObserver(this); 411 download_item_->RemoveObserver(this);
412 download_item_->Remove(); 412 download_item_->Remove();
413 download_item_ = NULL; 413 download_item_ = NULL;
414 } 414 }
415 crx_installer_ = NULL; 415 crx_installer_ = NULL;
416 416
417 if (pending_modules_.empty()) { 417 if (pending_modules_.empty()) {
418 CHECK_EQ(extension->id(), id_); 418 CHECK_EQ(extension->id(), id_);
419 ReportSuccess(); 419 ReportSuccess();
420 } else { 420 } else {
421 const Version version_required(info.minimum_version); 421 const base::Version version_required(info.minimum_version);
422 if (version_required.IsValid() && 422 if (version_required.IsValid() &&
423 extension->version()->CompareTo(version_required) < 0) { 423 extension->version()->CompareTo(version_required) < 0) {
424 // It should not happen, CrxInstaller will make sure the version is 424 // It should not happen, CrxInstaller will make sure the version is
425 // equal or newer than version_required. 425 // equal or newer than version_required.
426 ReportFailure(kDependencyNotFoundError, 426 ReportFailure(kDependencyNotFoundError,
427 FAILURE_REASON_DEPENDENCY_NOT_FOUND); 427 FAILURE_REASON_DEPENDENCY_NOT_FOUND);
428 } else if (!SharedModuleInfo::IsSharedModule(extension)) { 428 } else if (!SharedModuleInfo::IsSharedModule(extension)) {
429 // It should not happen, CrxInstaller will make sure it is a shared 429 // It should not happen, CrxInstaller will make sure it is a shared
430 // module. 430 // module.
431 ReportFailure(kDependencyNotSharedModuleError, 431 ReportFailure(kDependencyNotSharedModuleError,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 483
484 DCHECK_EQ(content::DOWNLOAD_INTERRUPT_REASON_NONE, interrupt_reason); 484 DCHECK_EQ(content::DOWNLOAD_INTERRUPT_REASON_NONE, interrupt_reason);
485 DCHECK(!pending_modules_.empty()); 485 DCHECK(!pending_modules_.empty());
486 download_item_ = item; 486 download_item_ = item;
487 download_item_->AddObserver(this); 487 download_item_->AddObserver(this);
488 if (pending_modules_.size() > 1) { 488 if (pending_modules_.size() > 1) {
489 // We are downloading a shared module. We need create an approval for it. 489 // We are downloading a shared module. We need create an approval for it.
490 scoped_ptr<Approval> approval = Approval::CreateForSharedModule(profile_); 490 scoped_ptr<Approval> approval = Approval::CreateForSharedModule(profile_);
491 const SharedModuleInfo::ImportInfo& info = pending_modules_.front(); 491 const SharedModuleInfo::ImportInfo& info = pending_modules_.front();
492 approval->extension_id = info.extension_id; 492 approval->extension_id = info.extension_id;
493 const Version version_required(info.minimum_version); 493 const base::Version version_required(info.minimum_version);
494 494
495 if (version_required.IsValid()) { 495 if (version_required.IsValid()) {
496 approval->minimum_version.reset( 496 approval->minimum_version.reset(new base::Version(version_required));
497 new Version(version_required));
498 } 497 }
499 download_item_->SetUserData(kApprovalKey, approval.release()); 498 download_item_->SetUserData(kApprovalKey, approval.release());
500 } else { 499 } else {
501 // It is for the main module of the extension. We should use the provided 500 // It is for the main module of the extension. We should use the provided
502 // |approval_|. 501 // |approval_|.
503 if (approval_) 502 if (approval_)
504 download_item_->SetUserData(kApprovalKey, approval_.release()); 503 download_item_->SetUserData(kApprovalKey, approval_.release());
505 } 504 }
506 505
507 if (!download_started_) { 506 if (!download_started_) {
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 1, 782 1,
784 kMaxSizeKb, 783 kMaxSizeKb,
785 kNumBuckets); 784 kNumBuckets);
786 } 785 }
787 UMA_HISTOGRAM_BOOLEAN( 786 UMA_HISTOGRAM_BOOLEAN(
788 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown", 787 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown",
789 total_bytes <= 0); 788 total_bytes <= 0);
790 } 789 }
791 790
792 } // namespace extensions 791 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_installer.h ('k') | chrome/browser/hang_monitor/hung_plugin_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698