1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/views/app_list/win/app_list_controller_delegate_win.h"
7 #include "apps/app_window.h"
8 #include "apps/app_window_registry.h"
9 #include "chrome/browser/metro_utils/metro_chrome_win.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/app_list/app_list_icon_win.h"
12 #include "chrome/browser/ui/extensions/application_launch.h"
13 #include "chrome/browser/ui/host_desktop.h"
14 #include "ui/base/resource/resource_bundle.h"
16 AppListControllerDelegateWin::AppListControllerDelegateWin(
17 AppListServiceViews* service)
18 : AppListControllerDelegateViews(service) {}
20 AppListControllerDelegateWin::~AppListControllerDelegateWin() {}
22 bool AppListControllerDelegateWin::ForceNativeDesktop() const {
26 gfx::ImageSkia AppListControllerDelegateWin::GetWindowIcon() {
27 gfx::ImageSkia* resource = ResourceBundle::GetSharedInstance().
28 GetImageSkiaNamed(GetAppListIconResourceId());
32 void AppListControllerDelegateWin::FillLaunchParams(AppLaunchParams* params) {
33 params->desktop_type = chrome::HOST_DESKTOP_TYPE_NATIVE;
34 apps::AppWindow* any_existing_window =
35 apps::AppWindowRegistry::Get(params->profile)
36 ->GetCurrentAppWindowForApp(params->extension_id);
37 if (any_existing_window &&
38 chrome::GetHostDesktopTypeForNativeWindow(
39 any_existing_window->GetNativeWindow())
40 != chrome::HOST_DESKTOP_TYPE_NATIVE) {
41 params->desktop_type = chrome::HOST_DESKTOP_TYPE_ASH;
42 chrome::ActivateMetroChrome();