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_uninstall_dialog.h" | 5 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 Profile* profile, | 22 Profile* profile, |
23 ExtensionUninstallDialog::Delegate* delegate) | 23 ExtensionUninstallDialog::Delegate* delegate) |
24 : profile_(profile), | 24 : profile_(profile), |
25 delegate_(delegate), | 25 delegate_(delegate), |
26 extension_(NULL), | 26 extension_(NULL), |
27 ui_loop_(MessageLoop::current()), | 27 ui_loop_(MessageLoop::current()), |
28 ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) {} | 28 ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) {} |
29 | 29 |
30 ExtensionUninstallDialog::~ExtensionUninstallDialog() {} | 30 ExtensionUninstallDialog::~ExtensionUninstallDialog() {} |
31 | 31 |
32 void ExtensionUninstallDialog::ConfirmUninstall(const Extension* extension) { | 32 void ExtensionUninstallDialog::ConfirmUninstall( |
| 33 const extensions::Extension* extension) { |
33 DCHECK(ui_loop_ == MessageLoop::current()); | 34 DCHECK(ui_loop_ == MessageLoop::current()); |
34 extension_ = extension; | 35 extension_ = extension; |
35 | 36 |
36 ExtensionResource image = | 37 ExtensionResource image = |
37 extension_->GetIconResource(ExtensionIconSet::EXTENSION_ICON_LARGE, | 38 extension_->GetIconResource(ExtensionIconSet::EXTENSION_ICON_LARGE, |
38 ExtensionIconSet::MATCH_BIGGER); | 39 ExtensionIconSet::MATCH_BIGGER); |
39 // Load the image asynchronously. The response will be sent to OnImageLoaded. | 40 // Load the image asynchronously. The response will be sent to OnImageLoaded. |
40 tracker_.LoadImage(extension_, image, | 41 tracker_.LoadImage(extension_, image, |
41 gfx::Size(kIconSize, kIconSize), | 42 gfx::Size(kIconSize, kIconSize), |
42 ImageLoadingTracker::DONT_CACHE); | 43 ImageLoadingTracker::DONT_CACHE); |
(...skipping 13 matching lines...) Expand all Loading... |
56 } | 57 } |
57 } | 58 } |
58 | 59 |
59 void ExtensionUninstallDialog::OnImageLoaded(const gfx::Image& image, | 60 void ExtensionUninstallDialog::OnImageLoaded(const gfx::Image& image, |
60 const std::string& extension_id, | 61 const std::string& extension_id, |
61 int index) { | 62 int index) { |
62 SetIcon(image); | 63 SetIcon(image); |
63 | 64 |
64 Show(); | 65 Show(); |
65 } | 66 } |
OLD | NEW |