| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 GTK_DIALOG(dialog), | 67 GTK_DIALOG(dialog), |
| 68 cancel > 0 ? l10n_util::GetStringUTF8(cancel).c_str(): GTK_STOCK_CANCEL, | 68 cancel > 0 ? l10n_util::GetStringUTF8(cancel).c_str(): GTK_STOCK_CANCEL, |
| 69 GTK_RESPONSE_CLOSE); | 69 GTK_RESPONSE_CLOSE); |
| 70 gtk_dialog_add_button( | 70 gtk_dialog_add_button( |
| 71 GTK_DIALOG(dialog), | 71 GTK_DIALOG(dialog), |
| 72 l10n_util::GetStringUTF8(ExtensionInstallUI::kButtonIds[type]).c_str(), | 72 l10n_util::GetStringUTF8(ExtensionInstallUI::kButtonIds[type]).c_str(), |
| 73 GTK_RESPONSE_ACCEPT); | 73 GTK_RESPONSE_ACCEPT); |
| 74 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); | 74 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); |
| 75 | 75 |
| 76 // Create a two column layout. | 76 // Create a two column layout. |
| 77 GtkWidget* content_area = GTK_DIALOG(dialog)->vbox; | 77 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); |
| 78 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); | 78 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); |
| 79 | 79 |
| 80 GtkWidget* icon_hbox = gtk_hbox_new(FALSE, gtk_util::kContentAreaSpacing); | 80 GtkWidget* icon_hbox = gtk_hbox_new(FALSE, gtk_util::kContentAreaSpacing); |
| 81 gtk_box_pack_start(GTK_BOX(content_area), icon_hbox, TRUE, TRUE, 0); | 81 gtk_box_pack_start(GTK_BOX(content_area), icon_hbox, TRUE, TRUE, 0); |
| 82 | 82 |
| 83 // Resize the icon if necessary. | 83 // Resize the icon if necessary. |
| 84 SkBitmap scaled_icon = *skia_icon; | 84 SkBitmap scaled_icon = *skia_icon; |
| 85 if (scaled_icon.width() > kImageSize || scaled_icon.height() > kImageSize) { | 85 if (scaled_icon.width() > kImageSize || scaled_icon.height() > kImageSize) { |
| 86 scaled_icon = skia::ImageOperations::Resize(scaled_icon, | 86 scaled_icon = skia::ImageOperations::Resize(scaled_icon, |
| 87 skia::ImageOperations::RESIZE_LANCZOS3, | 87 skia::ImageOperations::RESIZE_LANCZOS3, |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 BrowserWindowGtk* browser_window = static_cast<BrowserWindowGtk*>( | 188 BrowserWindowGtk* browser_window = static_cast<BrowserWindowGtk*>( |
| 189 browser->window()); | 189 browser->window()); |
| 190 if (!browser_window) { | 190 if (!browser_window) { |
| 191 delegate->InstallUIAbort(false); | 191 delegate->InstallUIAbort(false); |
| 192 return; | 192 return; |
| 193 } | 193 } |
| 194 | 194 |
| 195 ShowInstallDialog( | 195 ShowInstallDialog( |
| 196 browser_window->window(), icon, extension, delegate, permissions, type); | 196 browser_window->window(), icon, extension, delegate, permissions, type); |
| 197 } | 197 } |
| OLD | NEW |