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