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

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

Issue 153393002: Accept smaller icons for the extension uninstall dialog for bookmark apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 } 67 }
68 68
69 ExtensionUninstallDialog::~ExtensionUninstallDialog() { 69 ExtensionUninstallDialog::~ExtensionUninstallDialog() {
70 } 70 }
71 71
72 void ExtensionUninstallDialog::ConfirmUninstall( 72 void ExtensionUninstallDialog::ConfirmUninstall(
73 const extensions::Extension* extension) { 73 const extensions::Extension* extension) {
74 DCHECK(ui_loop_ == base::MessageLoop::current()); 74 DCHECK(ui_loop_ == base::MessageLoop::current());
75 extension_ = extension; 75 extension_ = extension;
76 // Bookmark apps may not have 128x128 icons so accept 48x48 icons.
77 const int icon_size = extension_->from_bookmark()
78 ? extension_misc::EXTENSION_ICON_MEDIUM
79 : extension_misc::EXTENSION_ICON_LARGE;
76 extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource( 80 extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource(
77 extension_, 81 extension_,
78 extension_misc::EXTENSION_ICON_LARGE, 82 icon_size,
79 ExtensionIconSet::MATCH_BIGGER); 83 ExtensionIconSet::MATCH_BIGGER);
80 // Load the icon whose pixel size is large enough to be displayed under 84 // Load the icon whose pixel size is large enough to be displayed under
81 // maximal supported scale factor. UI code will scale the icon down if needed. 85 // maximal supported scale factor. UI code will scale the icon down if needed.
82 int pixel_size = GetSizeForMaxScaleFactor(kIconSize); 86 int pixel_size = GetSizeForMaxScaleFactor(kIconSize);
83 87
84 // Load the image asynchronously. The response will be sent to OnImageLoaded. 88 // Load the image asynchronously. The response will be sent to OnImageLoaded.
85 state_ = kImageIsLoading; 89 state_ = kImageIsLoading;
86 extensions::ImageLoader* loader = 90 extensions::ImageLoader* loader =
87 extensions::ImageLoader::Get(profile_); 91 extensions::ImageLoader::Get(profile_);
88 loader->LoadImageAsync(extension_, image, 92 loader->LoadImageAsync(extension_, image,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 129
126 browser_ = NULL; 130 browser_ = NULL;
127 // If the browser is closed while waiting for the image, we need to send a 131 // If the browser is closed while waiting for the image, we need to send a
128 // "cancel" event here, because there will not be another opportunity to 132 // "cancel" event here, because there will not be another opportunity to
129 // notify the delegate of the cancellation as we won't open the dialog. 133 // notify the delegate of the cancellation as we won't open the dialog.
130 if (state_ == kImageIsLoading) { 134 if (state_ == kImageIsLoading) {
131 state_ = kBrowserIsClosing; 135 state_ = kBrowserIsClosing;
132 delegate_->ExtensionUninstallCanceled(); 136 delegate_->ExtensionUninstallCanceled();
133 } 137 }
134 } 138 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698