diff options
-rw-r--r-- | ash/shell/app_list.cc | 5 | ||||
-rw-r--r-- | chrome/app/theme/theme_resources.grd | 5 | ||||
-rw-r--r-- | chrome/browser/ui/app_list/app_list_controller_delegate.cc | 5 | ||||
-rw-r--r-- | chrome/browser/ui/app_list/app_list_controller_delegate.h | 7 | ||||
-rw-r--r-- | chrome/browser/ui/app_list/app_list_view_delegate.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/app_list/app_list_view_delegate.h | 1 | ||||
-rw-r--r-- | chrome/browser/ui/views/app_list/app_list_controller_win.cc | 11 | ||||
-rw-r--r-- | ui/app_list/app_list_view_delegate.h | 7 | ||||
-rw-r--r-- | ui/app_list/views/app_list_view.cc | 8 | ||||
-rw-r--r-- | ui/app_list/views/app_list_view.h | 1 |
10 files changed, 53 insertions, 1 deletions
diff --git a/ash/shell/app_list.cc b/ash/shell/app_list.cc index 4415370..ce09d97 100644 --- a/ash/shell/app_list.cc +++ b/ash/shell/app_list.cc @@ -20,6 +20,7 @@ #include "ui/app_list/search_result.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" +#include "ui/gfx/image/image_skia.h" #include "ui/gfx/rect.h" #include "ui/views/examples/examples_window_with_content.h" @@ -288,6 +289,10 @@ class ExampleAppListViewDelegate : public app_list::AppListViewDelegate { // Nothing needs to be done. } + virtual gfx::ImageSkia GetWindowIcon() OVERRIDE { + return gfx::ImageSkia(); + } + app_list::AppListModel* model_; DISALLOW_COPY_AND_ASSIGN(ExampleAppListViewDelegate); diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd index 1114699..ced1636 100644 --- a/chrome/app/theme/theme_resources.grd +++ b/chrome/app/theme/theme_resources.grd @@ -42,7 +42,10 @@ <structure type="chrome_scaled_image" name="IDR_ALLOWED_JAVASCRIPT" file="allowed_script.png" /> <structure type="chrome_scaled_image" name="IDR_APP_DEFAULT_ICON" file="app_default_icon.png" /> <structure type="chrome_scaled_image" name="IDR_APP_DROPARROW" file="app_droparrow.png" /> - <if expr="pp_ifdef('enable_settings_app')"> + <if expr="pp_ifdef('enable_app_list') and is_win"> + <structure type="chrome_scaled_image" name="IDR_APP_LIST" file="win/app_list.png" /> + </if> + <if expr="pp_ifdef('enable_app_list') and not pp_ifdef('chromeos')"> <structure type="chrome_scaled_image" name="IDR_APP_LIST_TAB_OVERLAY" file="app_list_tab_overlay.png" /> </if> <structure type="chrome_scaled_image" name="IDR_APP_NOTIFICATION_NUB" file="nub.png" /> diff --git a/chrome/browser/ui/app_list/app_list_controller_delegate.cc b/chrome/browser/ui/app_list/app_list_controller_delegate.cc index 431fb17..fa04f2b 100644 --- a/chrome/browser/ui/app_list/app_list_controller_delegate.cc +++ b/chrome/browser/ui/app_list/app_list_controller_delegate.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" #include "base/logging.h" +#include "ui/gfx/image/image_skia.h" AppListControllerDelegate::~AppListControllerDelegate() {} @@ -12,6 +13,10 @@ void AppListControllerDelegate::ViewClosing() {} void AppListControllerDelegate::ViewActivationChanged(bool active) {} +gfx::ImageSkia AppListControllerDelegate::GetWindowIcon() { + return gfx::ImageSkia(); +} + bool AppListControllerDelegate::IsAppPinned(const std::string& extension_id) { return false; } diff --git a/chrome/browser/ui/app_list/app_list_controller_delegate.h b/chrome/browser/ui/app_list/app_list_controller_delegate.h index 9c19c6d02..6a8c51f8 100644 --- a/chrome/browser/ui/app_list/app_list_controller_delegate.h +++ b/chrome/browser/ui/app_list/app_list_controller_delegate.h @@ -15,6 +15,10 @@ namespace extensions { class Extension; } +namespace gfx { +class ImageSkia; +} + // Interface to allow the view delegate to call out to whatever is controlling // the app list. This will have different implementations for different // platforms. @@ -34,6 +38,9 @@ class AppListControllerDelegate { // Get app list window. virtual gfx::NativeWindow GetAppListWindow() = 0; + // Get the application icon to be used, if any, for the app list. + virtual gfx::ImageSkia GetWindowIcon(); + // Control of pinning apps. virtual bool IsAppPinned(const std::string& extension_id); virtual void PinApp(const std::string& extension_id); diff --git a/chrome/browser/ui/app_list/app_list_view_delegate.cc b/chrome/browser/ui/app_list/app_list_view_delegate.cc index 15d294e..51998c8 100644 --- a/chrome/browser/ui/app_list/app_list_view_delegate.cc +++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc @@ -112,3 +112,7 @@ void AppListViewDelegate::ViewClosing() { void AppListViewDelegate::ViewActivationChanged(bool active) { controller_->ViewActivationChanged(active); } + +gfx::ImageSkia AppListViewDelegate::GetWindowIcon() { + return controller_->GetWindowIcon(); +} diff --git a/chrome/browser/ui/app_list/app_list_view_delegate.h b/chrome/browser/ui/app_list/app_list_view_delegate.h index 4bd04b4..145fcd5 100644 --- a/chrome/browser/ui/app_list/app_list_view_delegate.h +++ b/chrome/browser/ui/app_list/app_list_view_delegate.h @@ -56,6 +56,7 @@ class AppListViewDelegate : public app_list::AppListViewDelegate { virtual void Dismiss() OVERRIDE; virtual void ViewClosing() OVERRIDE; virtual void ViewActivationChanged(bool active) OVERRIDE; + virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; scoped_ptr<app_list::SigninDelegate> signin_delegate_; scoped_ptr<AppsModelBuilder> apps_builder_; diff --git a/chrome/browser/ui/views/app_list/app_list_controller_win.cc b/chrome/browser/ui/views/app_list/app_list_controller_win.cc index 5fe7960..710bfe2 100644 --- a/chrome/browser/ui/views/app_list/app_list_controller_win.cc +++ b/chrome/browser/ui/views/app_list/app_list_controller_win.cc @@ -37,11 +37,14 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/google_chrome_strings.h" +#include "grit/theme_resources.h" #include "ui/app_list/pagination_model.h" #include "ui/app_list/views/app_list_view.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/resource/resource_bundle.h" #include "ui/base/win/shell.h" #include "ui/gfx/display.h" +#include "ui/gfx/image/image_skia.h" #include "ui/gfx/screen.h" #include "ui/views/bubble/bubble_border.h" #include "ui/views/widget/widget.h" @@ -130,6 +133,7 @@ class AppListControllerDelegateWin : public AppListControllerDelegate { virtual void ViewClosing() OVERRIDE; virtual void ViewActivationChanged(bool active) OVERRIDE; virtual gfx::NativeWindow GetAppListWindow() OVERRIDE; + virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; virtual bool CanPin() OVERRIDE; virtual void OnShowExtensionPrompt() OVERRIDE; virtual void OnCloseExtensionPrompt() OVERRIDE; @@ -289,6 +293,12 @@ gfx::NativeWindow AppListControllerDelegateWin::GetAppListWindow() { return view ? view->GetWidget()->GetNativeWindow() : NULL; } +gfx::ImageSkia AppListControllerDelegateWin::GetWindowIcon() { + gfx::ImageSkia* resource = ResourceBundle::GetSharedInstance(). + GetImageSkiaNamed(IDR_APP_LIST); + return *resource; +} + bool AppListControllerDelegateWin::CanPin() { return false; } @@ -473,6 +483,7 @@ void AppListController::ShowAppList(Profile* profile) { gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint(); UpdateArrowPositionAndAnchorPoint(cursor); current_view_->Show(); + current_view_->GetWidget()->GetTopLevelWidget()->UpdateWindowIcon(); current_view_->GetWidget()->Activate(); current_view_->GetWidget()->SetAlwaysOnTop(true); } diff --git a/ui/app_list/app_list_view_delegate.h b/ui/app_list/app_list_view_delegate.h index 5143544..c289151 100644 --- a/ui/app_list/app_list_view_delegate.h +++ b/ui/app_list/app_list_view_delegate.h @@ -7,6 +7,10 @@ #include "ui/app_list/app_list_export.h" +namespace gfx { +class ImageSkia; +} + namespace app_list { class AppListItemModel; @@ -57,6 +61,9 @@ class APP_LIST_EXPORT AppListViewDelegate { // Invoked when the app list's activated state changes. virtual void ViewActivationChanged(bool active) = 0; + + // Returns the icon to be displayed in the window and taskbar. + virtual gfx::ImageSkia GetWindowIcon() = 0; }; } // namespace app_list diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc index f946b4c..6b099fd 100644 --- a/ui/app_list/views/app_list_view.cc +++ b/ui/app_list/views/app_list_view.cc @@ -14,6 +14,7 @@ #include "ui/app_list/views/app_list_main_view.h" #include "ui/app_list/views/search_box_view.h" #include "ui/app_list/views/signin_view.h" +#include "ui/gfx/image/image_skia.h" #include "ui/gfx/insets.h" #include "ui/gfx/path.h" #include "ui/gfx/skia_util.h" @@ -140,6 +141,13 @@ views::View* AppListView::GetInitiallyFocusedView() { return app_list_main_view_->search_box_view()->search_box(); } +gfx::ImageSkia AppListView::GetWindowIcon() { + if (delegate_.get()) + return delegate_->GetWindowIcon(); + + return gfx::ImageSkia(); +} + bool AppListView::WidgetHasHitTestMask() const { return true; } diff --git a/ui/app_list/views/app_list_view.h b/ui/app_list/views/app_list_view.h index 45ac04f..163ec7e 100644 --- a/ui/app_list/views/app_list_view.h +++ b/ui/app_list/views/app_list_view.h @@ -58,6 +58,7 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView, private: // Overridden from views::WidgetDelegateView: virtual views::View* GetInitiallyFocusedView() OVERRIDE; + virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; virtual bool WidgetHasHitTestMask() const OVERRIDE; virtual void GetWidgetHitTestMask(gfx::Path* mask) const OVERRIDE; |