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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 NULL); | 84 NULL); |
85 GtkWidget* close_button = gtk_dialog_add_button( | 85 GtkWidget* close_button = gtk_dialog_add_button( |
86 GTK_DIALOG(dialog_), | 86 GTK_DIALOG(dialog_), |
87 prompt.HasAbortButtonLabel() ? | 87 prompt.HasAbortButtonLabel() ? |
88 UTF16ToUTF8(prompt.GetAbortButtonLabel()).c_str() : GTK_STOCK_CANCEL, | 88 UTF16ToUTF8(prompt.GetAbortButtonLabel()).c_str() : GTK_STOCK_CANCEL, |
89 GTK_RESPONSE_CLOSE); | 89 GTK_RESPONSE_CLOSE); |
90 gtk_dialog_add_button( | 90 gtk_dialog_add_button( |
91 GTK_DIALOG(dialog_), | 91 GTK_DIALOG(dialog_), |
92 UTF16ToUTF8(prompt.GetAcceptButtonLabel()).c_str(), | 92 UTF16ToUTF8(prompt.GetAcceptButtonLabel()).c_str(), |
93 GTK_RESPONSE_ACCEPT); | 93 GTK_RESPONSE_ACCEPT); |
| 94 #if !GTK_CHECK_VERSION(2, 22, 0) |
94 gtk_dialog_set_has_separator(GTK_DIALOG(dialog_), FALSE); | 95 gtk_dialog_set_has_separator(GTK_DIALOG(dialog_), FALSE); |
| 96 #endif |
95 | 97 |
96 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); | 98 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); |
97 gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); | 99 gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); |
98 | 100 |
99 // Divide the dialog vertically (item data and icon on the top, permissions | 101 // Divide the dialog vertically (item data and icon on the top, permissions |
100 // on the bottom). | 102 // on the bottom). |
101 GtkWidget* content_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); | 103 GtkWidget* content_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); |
102 gtk_box_pack_start(GTK_BOX(content_area), content_vbox, TRUE, TRUE, 0); | 104 gtk_box_pack_start(GTK_BOX(content_area), content_vbox, TRUE, TRUE, 0); |
103 | 105 |
104 // Create a two column layout for the top (item data on the left, icon on | 106 // Create a two column layout for the top (item data on the left, icon on |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 delegate->InstallUIAbort(false); | 256 delegate->InstallUIAbort(false); |
255 return; | 257 return; |
256 } | 258 } |
257 | 259 |
258 new ExtensionInstallDialog(browser_window->window(), | 260 new ExtensionInstallDialog(browser_window->window(), |
259 delegate, | 261 delegate, |
260 extension, | 262 extension, |
261 icon, | 263 icon, |
262 prompt); | 264 prompt); |
263 } | 265 } |
OLD | NEW |