| 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" |
| 11 #include "chrome/browser/extensions/extension_install_dialog.h" | 11 #include "chrome/browser/extensions/extension_install_dialog.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/browser_finder.h" |
| 13 #include "chrome/browser/ui/browser_list.h" | 14 #include "chrome/browser/ui/browser_list.h" |
| 14 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
| 15 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 16 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 16 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" | 17 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" |
| 17 #include "chrome/browser/ui/gtk/gtk_util.h" | 18 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 18 #include "chrome/common/extensions/extension.h" | 19 #include "chrome/common/extensions/extension.h" |
| 19 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
| 20 #include "skia/ext/image_operations.h" | 21 #include "skia/ext/image_operations.h" |
| 21 #include "ui/base/gtk/gtk_hig_constants.h" | 22 #include "ui/base/gtk/gtk_hig_constants.h" |
| 22 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 259 |
| 259 OnResponse(dialog_, GTK_RESPONSE_CLOSE); | 260 OnResponse(dialog_, GTK_RESPONSE_CLOSE); |
| 260 } | 261 } |
| 261 | 262 |
| 262 } // namespace | 263 } // namespace |
| 263 | 264 |
| 264 void ShowExtensionInstallDialogImpl( | 265 void ShowExtensionInstallDialogImpl( |
| 265 Profile* profile, | 266 Profile* profile, |
| 266 ExtensionInstallUI::Delegate* delegate, | 267 ExtensionInstallUI::Delegate* delegate, |
| 267 const ExtensionInstallUI::Prompt& prompt) { | 268 const ExtensionInstallUI::Prompt& prompt) { |
| 268 Browser* browser = BrowserList::GetLastActiveWithProfile(profile); | 269 Browser* browser = browser::FindLastActiveWithProfile(profile); |
| 269 if (!browser) { | 270 if (!browser) { |
| 270 delegate->InstallUIAbort(false); | 271 delegate->InstallUIAbort(false); |
| 271 return; | 272 return; |
| 272 } | 273 } |
| 273 | 274 |
| 274 BrowserWindowGtk* browser_window = static_cast<BrowserWindowGtk*>( | 275 BrowserWindowGtk* browser_window = static_cast<BrowserWindowGtk*>( |
| 275 browser->window()); | 276 browser->window()); |
| 276 if (!browser_window) { | 277 if (!browser_window) { |
| 277 delegate->InstallUIAbort(false); | 278 delegate->InstallUIAbort(false); |
| 278 return; | 279 return; |
| 279 } | 280 } |
| 280 | 281 |
| 281 new ExtensionInstallDialog(browser_window->window(), delegate, prompt); | 282 new ExtensionInstallDialog(browser_window->window(), delegate, prompt); |
| 282 } | 283 } |
| OLD | NEW |