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 // Currently this file is only used for the uninstall prompt. The install prompt | 5 // Currently this file is only used for the uninstall prompt. The install prompt |
6 // code is in extension_install_prompt2_gtk.cc. | 6 // code is in extension_install_prompt2_gtk.cc. |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 gtk_misc_set_alignment(GTK_MISC(heading_label), 0.0, 0.5); | 80 gtk_misc_set_alignment(GTK_MISC(heading_label), 0.0, 0.5); |
81 gtk_box_pack_start(GTK_BOX(right_column_area), heading_label, TRUE, TRUE, 0); | 81 gtk_box_pack_start(GTK_BOX(right_column_area), heading_label, TRUE, TRUE, 0); |
82 | 82 |
83 g_signal_connect(dialog, "response", G_CALLBACK(OnResponse), delegate); | 83 g_signal_connect(dialog, "response", G_CALLBACK(OnResponse), delegate); |
84 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); | 84 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
85 gtk_widget_show_all(dialog); | 85 gtk_widget_show_all(dialog); |
86 } | 86 } |
87 | 87 |
88 } // namespace | 88 } // namespace |
89 | 89 |
90 void ShowExtensionInstallDialog(Profile* profile, | 90 void ShowGenericExtensionDialog(Profile* profile, |
91 ExtensionInstallUI::Delegate* delegate, | 91 ExtensionInstallUI::Delegate* delegate, |
92 const Extension* extension, | 92 const Extension* extension, |
93 SkBitmap* icon, | 93 SkBitmap* icon, |
94 ExtensionInstallUI::PromptType type) { | 94 ExtensionInstallUI::PromptType type) { |
95 Browser* browser = BrowserList::GetLastActiveWithProfile(profile); | 95 Browser* browser = BrowserList::GetLastActiveWithProfile(profile); |
96 if (!browser) { | 96 if (!browser) { |
97 delegate->InstallUIAbort(); | 97 delegate->InstallUIAbort(); |
98 return; | 98 return; |
99 } | 99 } |
100 | 100 |
101 BrowserWindowGtk* browser_window = static_cast<BrowserWindowGtk*>( | 101 BrowserWindowGtk* browser_window = static_cast<BrowserWindowGtk*>( |
102 browser->window()); | 102 browser->window()); |
103 if (!browser_window) { | 103 if (!browser_window) { |
104 delegate->InstallUIAbort(); | 104 delegate->InstallUIAbort(); |
105 return; | 105 return; |
106 } | 106 } |
107 | 107 |
108 ShowInstallPromptDialog(browser_window->window(), icon, extension, delegate, | 108 ShowInstallPromptDialog(browser_window->window(), icon, extension, delegate, |
109 type); | 109 type); |
110 } | 110 } |
OLD | NEW |