OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |