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

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

Issue 7835039: Implement the inline extensions/apps install UI for Cocoa. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/extensions/extension_install_dialog.h" 9 #include "chrome/browser/extensions/extension_install_dialog.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 14 matching lines...) Expand all
25 25
26 const int kLeftColumnMinWidth = 250; 26 const int kLeftColumnMinWidth = 250;
27 const int kImageSize = 69; 27 const int kImageSize = 69;
28 28
29 // Additional padding (beyond on ui::kControlSpacing) all sides of each 29 // Additional padding (beyond on ui::kControlSpacing) all sides of each
30 // permission in the permissions list. 30 // permission in the permissions list.
31 const int kPermissionsPadding = 2; 31 const int kPermissionsPadding = 2;
32 32
33 const double kRatingTextSize = 12.1; // 12.1px = 9pt @ 96dpi 33 const double kRatingTextSize = 12.1; // 12.1px = 9pt @ 96dpi
34 34
35 // Loads an image and adds it as an icon control to the given container. 35 // Adds a Skia image as an icon control to the given container.
36 GtkWidget* AddResourceIcon(int resource_id, GtkWidget* container) { 36 GtkWidget* AddResourceIcon(const SkBitmap* icon, GtkWidget* container) {
37 const SkBitmap* icon = ResourceBundle::GetSharedInstance().GetBitmapNamed(
38 resource_id);
39 GdkPixbuf* icon_pixbuf = gfx::GdkPixbufFromSkBitmap(icon); 37 GdkPixbuf* icon_pixbuf = gfx::GdkPixbufFromSkBitmap(icon);
40 GtkWidget* icon_widget = gtk_image_new_from_pixbuf(icon_pixbuf); 38 GtkWidget* icon_widget = gtk_image_new_from_pixbuf(icon_pixbuf);
41 g_object_unref(icon_pixbuf); 39 g_object_unref(icon_pixbuf);
42 gtk_box_pack_start(GTK_BOX(container), icon_widget, FALSE, FALSE, 0); 40 gtk_box_pack_start(GTK_BOX(container), icon_widget, FALSE, FALSE, 0);
43 return icon_widget; 41 return icon_widget;
44 } 42 }
45 43
46 // Displays the dialog when constructed, deletes itself when dialog is 44 // Displays the dialog when constructed, deletes itself when dialog is
47 // dismissed. Success/failure is passed back through the ExtensionInstallUI:: 45 // dismissed. Success/failure is passed back through the ExtensionInstallUI::
48 // Delegate instance. 46 // Delegate instance.
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 delegate->InstallUIAbort(false); 253 delegate->InstallUIAbort(false);
256 return; 254 return;
257 } 255 }
258 256
259 new ExtensionInstallDialog(browser_window->window(), 257 new ExtensionInstallDialog(browser_window->window(),
260 delegate, 258 delegate,
261 extension, 259 extension,
262 icon, 260 icon,
263 prompt); 261 prompt);
264 } 262 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698