Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: chrome/browser/ui/gtk/extensions/extension_generic_dialog_gtk.cc

Issue 6721013: extensions: Refactor ExtensionInstallUI class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add SetIcon and call it Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698