OLD | NEW |
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 dialog_ = gtk_dialog_new_with_buttons( | 128 dialog_ = gtk_dialog_new_with_buttons( |
129 UTF16ToUTF8(prompt.GetDialogTitle()).c_str(), | 129 UTF16ToUTF8(prompt.GetDialogTitle()).c_str(), |
130 parent, | 130 parent, |
131 GTK_DIALOG_MODAL, | 131 GTK_DIALOG_MODAL, |
132 NULL); | 132 NULL); |
133 GtkWidget* close_button = gtk_dialog_add_button( | 133 GtkWidget* close_button = gtk_dialog_add_button( |
134 GTK_DIALOG(dialog_), | 134 GTK_DIALOG(dialog_), |
135 prompt.HasAbortButtonLabel() ? | 135 prompt.HasAbortButtonLabel() ? |
136 UTF16ToUTF8(prompt.GetAbortButtonLabel()).c_str() : GTK_STOCK_CANCEL, | 136 UTF16ToUTF8(prompt.GetAbortButtonLabel()).c_str() : GTK_STOCK_CANCEL, |
137 GTK_RESPONSE_CLOSE); | 137 GTK_RESPONSE_CLOSE); |
138 gtk_dialog_add_button( | 138 if (prompt.HasAcceptButtonLabel()) { |
139 GTK_DIALOG(dialog_), | 139 gtk_dialog_add_button( |
140 UTF16ToUTF8(prompt.GetAcceptButtonLabel()).c_str(), | 140 GTK_DIALOG(dialog_), |
141 GTK_RESPONSE_ACCEPT); | 141 UTF16ToUTF8(prompt.GetAcceptButtonLabel()).c_str(), |
| 142 GTK_RESPONSE_ACCEPT); |
| 143 } |
142 #if !GTK_CHECK_VERSION(2, 22, 0) | 144 #if !GTK_CHECK_VERSION(2, 22, 0) |
143 gtk_dialog_set_has_separator(GTK_DIALOG(dialog_), FALSE); | 145 gtk_dialog_set_has_separator(GTK_DIALOG(dialog_), FALSE); |
144 #endif | 146 #endif |
145 | 147 |
146 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); | 148 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); |
147 gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); | 149 gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); |
148 | 150 |
149 // Divide the dialog vertically (item data and icon on the top, permissions | 151 // Divide the dialog vertically (item data and icon on the top, permissions |
150 // on the bottom). | 152 // on the bottom). |
151 GtkWidget* content_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); | 153 GtkWidget* content_vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 new chrome::ExtensionInstallDialog(show_params, delegate, prompt); | 402 new chrome::ExtensionInstallDialog(show_params, delegate, prompt); |
401 } | 403 } |
402 | 404 |
403 } // namespace | 405 } // namespace |
404 | 406 |
405 // static | 407 // static |
406 ExtensionInstallPrompt::ShowDialogCallback | 408 ExtensionInstallPrompt::ShowDialogCallback |
407 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { | 409 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { |
408 return base::Bind(&ShowExtensionInstallDialogImpl); | 410 return base::Bind(&ShowExtensionInstallDialogImpl); |
409 } | 411 } |
OLD | NEW |