| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 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_uninstall_dialog.h" | 9 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/ui/browser_list.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_finder.h" |
| 12 #include "chrome/browser/ui/browser_window.h" | 13 #include "chrome/browser/ui/browser_window.h" |
| 13 #include "chrome/common/extensions/extension.h" | 14 #include "chrome/common/extensions/extension.h" |
| 14 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
| 15 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 16 #include "ui/compositor/compositor.h" | 17 #include "ui/compositor/compositor.h" |
| 17 #include "ui/compositor/layer.h" | 18 #include "ui/compositor/layer.h" |
| 18 #include "ui/views/controls/image_view.h" | 19 #include "ui/views/controls/image_view.h" |
| 19 #include "ui/views/controls/label.h" | 20 #include "ui/views/controls/label.h" |
| 20 #include "ui/views/layout/layout_constants.h" | 21 #include "ui/views/layout/layout_constants.h" |
| 21 #include "ui/views/view.h" | 22 #include "ui/views/view.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 39 // use browser window of given |profile|. | 40 // use browser window of given |profile|. |
| 40 // Note this function could return NULL if ash app list is not visible and | 41 // Note this function could return NULL if ash app list is not visible and |
| 41 // there is no browser window open for |profile|. | 42 // there is no browser window open for |profile|. |
| 42 gfx::NativeWindow GetParent(Profile* profile) { | 43 gfx::NativeWindow GetParent(Profile* profile) { |
| 43 #if defined(USE_ASH) | 44 #if defined(USE_ASH) |
| 44 gfx::NativeWindow app_list = ash::Shell::GetInstance()->GetAppListWindow(); | 45 gfx::NativeWindow app_list = ash::Shell::GetInstance()->GetAppListWindow(); |
| 45 if (app_list) | 46 if (app_list) |
| 46 return app_list; | 47 return app_list; |
| 47 #endif | 48 #endif |
| 48 | 49 |
| 49 Browser* browser = BrowserList::GetLastActiveWithProfile(profile); | 50 Browser* browser = browser::FindLastActiveWithProfile(profile); |
| 50 if (browser && browser->window()) | 51 if (browser && browser->window()) |
| 51 return browser->window()->GetNativeHandle(); | 52 return browser->window()->GetNativeHandle(); |
| 52 | 53 |
| 53 return NULL; | 54 return NULL; |
| 54 } | 55 } |
| 55 | 56 |
| 56 // Views implementation of the uninstall dialog. | 57 // Views implementation of the uninstall dialog. |
| 57 class ExtensionUninstallDialogViews : public ExtensionUninstallDialog { | 58 class ExtensionUninstallDialogViews : public ExtensionUninstallDialog { |
| 58 public: | 59 public: |
| 59 ExtensionUninstallDialogViews(Profile* profile, | 60 ExtensionUninstallDialogViews(Profile* profile, |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 239 } |
| 239 } | 240 } |
| 240 | 241 |
| 241 } // namespace | 242 } // namespace |
| 242 | 243 |
| 243 // static | 244 // static |
| 244 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( | 245 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( |
| 245 Profile* profile, Delegate* delegate) { | 246 Profile* profile, Delegate* delegate) { |
| 246 return new ExtensionUninstallDialogViews(profile, delegate); | 247 return new ExtensionUninstallDialogViews(profile, delegate); |
| 247 } | 248 } |
| OLD | NEW |