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 // 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" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 12 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
13 #include "chrome/browser/ui/browser_list.h" | 13 #include "chrome/browser/ui/browser_finder.h" |
14 #include "chrome/browser/ui/browser_window.h" | 14 #include "chrome/browser/ui/browser_window.h" |
15 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 15 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
16 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
17 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
18 #include "ui/base/gtk/gtk_hig_constants.h" | 18 #include "ui/base/gtk/gtk_hig_constants.h" |
19 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
20 #include "ui/gfx/gtk_util.h" | 20 #include "ui/gfx/gtk_util.h" |
21 | 21 |
22 class Profile; | 22 class Profile; |
23 | 23 |
(...skipping 15 matching lines...) Expand all Loading... |
39 | 39 |
40 GtkWidget* dialog_; | 40 GtkWidget* dialog_; |
41 }; | 41 }; |
42 | 42 |
43 ExtensionUninstallDialogGtk::ExtensionUninstallDialogGtk( | 43 ExtensionUninstallDialogGtk::ExtensionUninstallDialogGtk( |
44 Profile* profile, ExtensionUninstallDialog::Delegate* delegate) | 44 Profile* profile, ExtensionUninstallDialog::Delegate* delegate) |
45 : ExtensionUninstallDialog(profile, delegate), | 45 : ExtensionUninstallDialog(profile, delegate), |
46 dialog_(NULL) {} | 46 dialog_(NULL) {} |
47 | 47 |
48 void ExtensionUninstallDialogGtk::Show() { | 48 void ExtensionUninstallDialogGtk::Show() { |
49 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); | 49 Browser* browser = browser::FindLastActiveWithProfile(profile_); |
50 if (!browser) { | 50 if (!browser) { |
51 delegate_->ExtensionUninstallCanceled(); | 51 delegate_->ExtensionUninstallCanceled(); |
52 return; | 52 return; |
53 } | 53 } |
54 | 54 |
55 BrowserWindow* browser_window = browser->window(); | 55 BrowserWindow* browser_window = browser->window(); |
56 if (!browser_window) { | 56 if (!browser_window) { |
57 delegate_->ExtensionUninstallCanceled(); | 57 delegate_->ExtensionUninstallCanceled(); |
58 return; | 58 return; |
59 } | 59 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 124 } |
125 | 125 |
126 } // namespace | 126 } // namespace |
127 | 127 |
128 // static | 128 // static |
129 // Platform specific implementation of the uninstall dialog show method. | 129 // Platform specific implementation of the uninstall dialog show method. |
130 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( | 130 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( |
131 Profile* profile, Delegate* delegate) { | 131 Profile* profile, Delegate* delegate) { |
132 return new ExtensionUninstallDialogGtk(profile, delegate); | 132 return new ExtensionUninstallDialogGtk(profile, delegate); |
133 } | 133 } |
OLD | NEW |