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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 SkBitmap* skia_icon, | 69 SkBitmap* skia_icon, |
70 const ExtensionInstallUI::Prompt& prompt) | 70 const ExtensionInstallUI::Prompt& prompt) |
71 : delegate_(delegate), | 71 : delegate_(delegate), |
72 extension_(extension) { | 72 extension_(extension) { |
73 bool show_permissions = prompt.GetPermissionCount() > 0; | 73 bool show_permissions = prompt.GetPermissionCount() > 0; |
74 bool is_inline_install = | 74 bool is_inline_install = |
75 prompt.type() == ExtensionInstallUI::INLINE_INSTALL_PROMPT; | 75 prompt.type() == ExtensionInstallUI::INLINE_INSTALL_PROMPT; |
76 | 76 |
77 // Build the dialog. | 77 // Build the dialog. |
78 dialog_ = gtk_dialog_new_with_buttons( | 78 dialog_ = gtk_dialog_new_with_buttons( |
79 UTF16ToUTF8(prompt.GetDialogTitle()).c_str(), | 79 UTF16ToUTF8(prompt.GetDialogTitle(extension)).c_str(), |
80 parent, | 80 parent, |
81 GTK_DIALOG_MODAL, | 81 GTK_DIALOG_MODAL, |
82 NULL); | 82 NULL); |
83 GtkWidget* close_button = gtk_dialog_add_button( | 83 GtkWidget* close_button = gtk_dialog_add_button( |
84 GTK_DIALOG(dialog_), | 84 GTK_DIALOG(dialog_), |
85 prompt.HasAbortButtonLabel() ? | 85 prompt.HasAbortButtonLabel() ? |
86 UTF16ToUTF8(prompt.GetAbortButtonLabel()).c_str() : GTK_STOCK_CANCEL, | 86 UTF16ToUTF8(prompt.GetAbortButtonLabel()).c_str() : GTK_STOCK_CANCEL, |
87 GTK_RESPONSE_CLOSE); | 87 GTK_RESPONSE_CLOSE); |
88 gtk_dialog_add_button( | 88 gtk_dialog_add_button( |
89 GTK_DIALOG(dialog_), | 89 GTK_DIALOG(dialog_), |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 delegate->InstallUIAbort(false); | 252 delegate->InstallUIAbort(false); |
253 return; | 253 return; |
254 } | 254 } |
255 | 255 |
256 new ExtensionInstallDialog(browser_window->window(), | 256 new ExtensionInstallDialog(browser_window->window(), |
257 delegate, | 257 delegate, |
258 extension, | 258 extension, |
259 icon, | 259 icon, |
260 prompt); | 260 prompt); |
261 } | 261 } |
OLD | NEW |