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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 permissions_container = left_column_area; | 250 permissions_container = left_column_area; |
251 } | 251 } |
252 | 252 |
253 GtkWidget* permissions_header = gtk_util::CreateBoldLabel( | 253 GtkWidget* permissions_header = gtk_util::CreateBoldLabel( |
254 UTF16ToUTF8(prompt.GetPermissionsHeading()).c_str()); | 254 UTF16ToUTF8(prompt.GetPermissionsHeading()).c_str()); |
255 gtk_util::SetLabelWidth(permissions_header, kLeftColumnMinWidth); | 255 gtk_util::SetLabelWidth(permissions_header, kLeftColumnMinWidth); |
256 gtk_box_pack_start(GTK_BOX(permissions_container), permissions_header, | 256 gtk_box_pack_start(GTK_BOX(permissions_container), permissions_header, |
257 FALSE, FALSE, 0); | 257 FALSE, FALSE, 0); |
258 | 258 |
259 for (size_t i = 0; i < prompt.GetPermissionCount(); ++i) { | 259 for (size_t i = 0; i < prompt.GetPermissionCount(); ++i) { |
260 GtkWidget* permission_label = gtk_label_new(UTF16ToUTF8( | 260 std::string permission = l10n_util::GetStringFUTF8( |
261 prompt.GetPermission(i)).c_str()); | 261 IDS_EXTENSION_PERMISSION_LINE, UTF16ToUTF8(prompt.GetPermission(i))); |
| 262 GtkWidget* permission_label = gtk_label_new(permission.c_str()); |
262 gtk_util::SetLabelWidth(permission_label, kLeftColumnMinWidth); | 263 gtk_util::SetLabelWidth(permission_label, kLeftColumnMinWidth); |
263 gtk_box_pack_start(GTK_BOX(permissions_container), permission_label, | 264 gtk_box_pack_start(GTK_BOX(permissions_container), permission_label, |
264 FALSE, FALSE, kPermissionsPadding); | 265 FALSE, FALSE, kPermissionsPadding); |
265 } | 266 } |
266 } | 267 } |
267 | 268 |
268 if (show_oauth_issues) { | 269 if (show_oauth_issues) { |
269 // If permissions are shown, then the scopes will go below them and take | 270 // If permissions are shown, then the scopes will go below them and take |
270 // up the entire width of the dialog. Otherwise the scopes will go where | 271 // up the entire width of the dialog. Otherwise the scopes will go where |
271 // the permissions usually go. | 272 // the permissions usually go. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 | 379 |
379 } // namespace browser | 380 } // namespace browser |
380 | 381 |
381 void ShowExtensionInstallDialogImpl( | 382 void ShowExtensionInstallDialogImpl( |
382 gfx::NativeWindow parent, | 383 gfx::NativeWindow parent, |
383 content::PageNavigator* navigator, | 384 content::PageNavigator* navigator, |
384 ExtensionInstallPrompt::Delegate* delegate, | 385 ExtensionInstallPrompt::Delegate* delegate, |
385 const ExtensionInstallPrompt::Prompt& prompt) { | 386 const ExtensionInstallPrompt::Prompt& prompt) { |
386 new browser::ExtensionInstallDialog(parent, navigator, delegate, prompt); | 387 new browser::ExtensionInstallDialog(parent, navigator, delegate, prompt); |
387 } | 388 } |
OLD | NEW |