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

Side by Side Diff: chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc

Issue 9460045: Add Mac interface for installing bundles of extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 <gtk/gtk.h> 5 #include <gtk/gtk.h>
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/extensions/bundle_installer.h" 10 #include "chrome/browser/extensions/bundle_installer.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 if (is_bundle_install) { 167 if (is_bundle_install) {
168 // Add the list of extensions to be installed. 168 // Add the list of extensions to be installed.
169 GtkWidget* extensions_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); 169 GtkWidget* extensions_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing);
170 gtk_box_pack_start(GTK_BOX(heading_vbox), extensions_vbox, FALSE, FALSE, 170 gtk_box_pack_start(GTK_BOX(heading_vbox), extensions_vbox, FALSE, FALSE,
171 ui::kControlSpacing); 171 ui::kControlSpacing);
172 172
173 BundleInstaller::ItemList items = prompt.bundle()->GetItemsWithState( 173 BundleInstaller::ItemList items = prompt.bundle()->GetItemsWithState(
174 BundleInstaller::Item::STATE_PENDING); 174 BundleInstaller::Item::STATE_PENDING);
175 for (size_t i = 0; i < items.size(); ++i) { 175 for (size_t i = 0; i < items.size(); ++i) {
176 string16 extension_name = UTF8ToUTF16(items[i].localized_name);
177 base::i18n::AdjustStringForLocaleDirection(&extension_name);
178
179 GtkWidget* extension_label = gtk_label_new(UTF16ToUTF8( 176 GtkWidget* extension_label = gtk_label_new(UTF16ToUTF8(
180 l10n_util::GetStringFUTF16( 177 items[i].GetNameForDisplay()).c_str());
181 IDS_EXTENSION_PERMISSION_LINE, extension_name)).c_str());
182 gtk_util::SetLabelWidth(extension_label, kLeftColumnMinWidth); 178 gtk_util::SetLabelWidth(extension_label, kLeftColumnMinWidth);
183 gtk_box_pack_start(GTK_BOX(extensions_vbox), extension_label, 179 gtk_box_pack_start(GTK_BOX(extensions_vbox), extension_label,
184 FALSE, FALSE, kExtensionsPadding); 180 FALSE, FALSE, kExtensionsPadding);
185 } 181 }
186 } 182 }
187 183
188 if (!is_bundle_install) { 184 if (!is_bundle_install) {
189 // Resize the icon if necessary. 185 // Resize the icon if necessary.
190 SkBitmap scaled_icon = prompt.icon(); 186 SkBitmap scaled_icon = prompt.icon();
191 if (scaled_icon.width() > kImageSize || scaled_icon.height() > kImageSize) { 187 if (scaled_icon.width() > kImageSize || scaled_icon.height() > kImageSize) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 273
278 BrowserWindowGtk* browser_window = static_cast<BrowserWindowGtk*>( 274 BrowserWindowGtk* browser_window = static_cast<BrowserWindowGtk*>(
279 browser->window()); 275 browser->window());
280 if (!browser_window) { 276 if (!browser_window) {
281 delegate->InstallUIAbort(false); 277 delegate->InstallUIAbort(false);
282 return; 278 return;
283 } 279 }
284 280
285 new ExtensionInstallDialog(browser_window->window(), delegate, prompt); 281 new ExtensionInstallDialog(browser_window->window(), delegate, prompt);
286 } 282 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/extensions/bundle_installed_bubble_gtk.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698