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

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

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/extension_uninstall_dialog.h" 5 #include "chrome/browser/extensions/extension_uninstall_dialog.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/extensions/image_loader.h" 10 #include "chrome/browser/extensions/image_loader.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 ExtensionUninstallDialog::ExtensionUninstallDialog( 56 ExtensionUninstallDialog::ExtensionUninstallDialog(
57 Profile* profile, 57 Profile* profile,
58 Browser* browser, 58 Browser* browser,
59 ExtensionUninstallDialog::Delegate* delegate) 59 ExtensionUninstallDialog::Delegate* delegate)
60 : profile_(profile), 60 : profile_(profile),
61 browser_(browser), 61 browser_(browser),
62 delegate_(delegate), 62 delegate_(delegate),
63 extension_(NULL), 63 extension_(NULL),
64 state_(kImageIsLoading), 64 state_(kImageIsLoading),
65 ui_loop_(MessageLoop::current()) { 65 ui_loop_(base::MessageLoop::current()) {
66 if (browser) { 66 if (browser) {
67 registrar_.Add(this, 67 registrar_.Add(this,
68 chrome::NOTIFICATION_BROWSER_CLOSED, 68 chrome::NOTIFICATION_BROWSER_CLOSED,
69 content::Source<Browser>(browser)); 69 content::Source<Browser>(browser));
70 } 70 }
71 } 71 }
72 72
73 ExtensionUninstallDialog::~ExtensionUninstallDialog() { 73 ExtensionUninstallDialog::~ExtensionUninstallDialog() {
74 } 74 }
75 75
76 void ExtensionUninstallDialog::ConfirmUninstall( 76 void ExtensionUninstallDialog::ConfirmUninstall(
77 const extensions::Extension* extension) { 77 const extensions::Extension* extension) {
78 DCHECK(ui_loop_ == MessageLoop::current()); 78 DCHECK(ui_loop_ == base::MessageLoop::current());
79 extension_ = extension; 79 extension_ = extension;
80 80
81 #if defined(ENABLE_MANAGED_USERS) && !defined(OS_CHROMEOS) 81 #if defined(ENABLE_MANAGED_USERS) && !defined(OS_CHROMEOS)
82 // If the profile belongs to a managed user, and the profile is not in 82 // If the profile belongs to a managed user, and the profile is not in
83 // elevated state, a passphrase dialog is shown, and if the custodian 83 // elevated state, a passphrase dialog is shown, and if the custodian
84 // authorizes by entering his passphrase, the uninstall is continued by 84 // authorizes by entering his passphrase, the uninstall is continued by
85 // calling |ExtensionUninstallAccepted| on the delegate. 85 // calling |ExtensionUninstallAccepted| on the delegate.
86 if (ShowAuthorizationDialog()) 86 if (ShowAuthorizationDialog())
87 return; 87 return;
88 #endif 88 #endif
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 ManagedUserService* service = ManagedUserServiceFactory::GetForProfile( 171 ManagedUserService* service = ManagedUserServiceFactory::GetForProfile(
172 profile_); 172 profile_);
173 DCHECK(service); 173 DCHECK(service);
174 service->AddElevationForExtension(extension_->id()); 174 service->AddElevationForExtension(extension_->id());
175 delegate_->ExtensionUninstallAccepted(); 175 delegate_->ExtensionUninstallAccepted();
176 } else { 176 } else {
177 delegate_->ExtensionUninstallCanceled(); 177 delegate_->ExtensionUninstallCanceled();
178 } 178 }
179 } 179 }
180 #endif 180 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698