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

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

Issue 156843004: Remove ExtensionService::extension_prefs() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: additional cleanup Created 6 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/crx_installer.h" 5 #include "chrome/browser/extensions/crx_installer.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 if (overlapping_extension && 588 if (overlapping_extension &&
589 overlapping_extension->id() != extension()->id()) { 589 overlapping_extension->id() != extension()->id()) {
590 ReportFailureFromUIThread( 590 ReportFailureFromUIThread(
591 CrxInstallerError( 591 CrxInstallerError(
592 l10n_util::GetStringFUTF16( 592 l10n_util::GetStringFUTF16(
593 IDS_EXTENSION_OVERLAPPING_WEB_EXTENT, 593 IDS_EXTENSION_OVERLAPPING_WEB_EXTENT,
594 base::UTF8ToUTF16(overlapping_extension->name())))); 594 base::UTF8ToUTF16(overlapping_extension->name()))));
595 return; 595 return;
596 } 596 }
597 597
598 current_version_ = 598 current_version_ = ExtensionPrefs::Get(service->profile())->
599 service->extension_prefs()->GetVersionString(extension()->id()); 599 GetVersionString(extension()->id());
600 600
601 if (client_ && 601 if (client_ &&
602 (!allow_silent_install_ || !approved_) && 602 (!allow_silent_install_ || !approved_) &&
603 !update_from_settings_page_) { 603 !update_from_settings_page_) {
604 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). 604 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort().
605 client_->ConfirmInstall(this, extension(), show_dialog_callback_); 605 client_->ConfirmInstall(this, extension(), show_dialog_callback_);
606 } else { 606 } else {
607 if (!installer_task_runner_->PostTask( 607 if (!installer_task_runner_->PostTask(
608 FROM_HERE, 608 FROM_HERE,
609 base::Bind(&CrxInstaller::CompleteInstall, this))) 609 base::Bind(&CrxInstaller::CompleteInstall, this)))
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 void CrxInstaller::ConfirmReEnable() { 856 void CrxInstaller::ConfirmReEnable() {
857 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 857 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
858 858
859 ExtensionService* service = service_weak_.get(); 859 ExtensionService* service = service_weak_.get();
860 if (!service || service->browser_terminating()) 860 if (!service || service->browser_terminating())
861 return; 861 return;
862 862
863 if (!update_from_settings_page_) 863 if (!update_from_settings_page_)
864 return; 864 return;
865 865
866 ExtensionPrefs* prefs = service->extension_prefs(); 866 ExtensionPrefs* prefs = ExtensionPrefs::Get(service->profile());
867 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) 867 if (!prefs->DidExtensionEscalatePermissions(extension()->id()))
868 return; 868 return;
869 869
870 if (client_) { 870 if (client_) {
871 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). 871 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort().
872 client_->ConfirmReEnable(this, extension()); 872 client_->ConfirmReEnable(this, extension());
873 } 873 }
874 } 874 }
875 875
876 } // namespace extensions 876 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698