Chromium Code Reviews| Index: chrome/browser/ui/app_list/app_list_service_views.h |
| diff --git a/chrome/browser/ui/views/app_list/linux/app_list_service_linux.h b/chrome/browser/ui/app_list/app_list_service_views.h |
| similarity index 36% |
| copy from chrome/browser/ui/views/app_list/linux/app_list_service_linux.h |
| copy to chrome/browser/ui/app_list/app_list_service_views.h |
| index 81a204695c91c6d29b6a439334aec381bb3d3972..552278a8d32686c299333478f8382ad7755728f0 100644 |
| --- a/chrome/browser/ui/views/app_list/linux/app_list_service_linux.h |
| +++ b/chrome/browser/ui/app_list/app_list_service_views.h |
| @@ -1,26 +1,34 @@ |
| -// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CHROME_BROWSER_UI_VIEWS_APP_LIST_LINUX_APP_LIST_SERVICE_LINUX_H_ |
| -#define CHROME_BROWSER_UI_VIEWS_APP_LIST_LINUX_APP_LIST_SERVICE_LINUX_H_ |
| +#ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ |
| +#define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ |
| #include "base/memory/scoped_ptr.h" |
| #include "chrome/browser/ui/app_list/app_list_service_impl.h" |
| +#include "chrome/browser/ui/app_list/app_list_shower_delegate.h" |
| +#include "chrome/browser/ui/app_list/app_list_shower_views.h" |
| -template <typename T> struct DefaultSingletonTraits; |
| +class AppListControllerDelegate; |
| -class AppListShower; |
| - |
| -// AppListServiceLinux manages global resources needed for the app list to |
| -// operate, and controls when the app list is opened and closed. |
| -class AppListServiceLinux : public AppListServiceImpl { |
| +// AppListServiceViews manages a desktop app list that uses toolkit-views. |
| +class AppListServiceViews : public AppListServiceImpl, |
| + public AppListShowerDelegate { |
| public: |
| - virtual ~AppListServiceLinux(); |
| + explicit AppListServiceViews( |
| + scoped_ptr<AppListControllerDelegate> controller_delegate); |
| + virtual ~AppListServiceViews(); |
| + |
| + // Set |can_dismiss| to prevent the app list dismissing when losing focus. For |
| + // example, while showing a window-modal dialog. |
| + void set_can_dismiss(bool can_dismiss) { can_dismiss_ = can_dismiss; } |
| - static AppListServiceLinux* GetInstance(); |
| - void set_can_close(bool can_close); |
| - void OnViewBeingDestroyed(); |
| + AppListShower& shower() { return shower_; } |
| + |
| + // Called by the AppListControllerDelegate when it is told that the app list |
| + // view must be destroyed. |
| + virtual void OnViewBeingDestroyed(); |
| // AppListService overrides: |
| virtual void Init(Profile* initial_profile) OVERRIDE; |
| @@ -32,19 +40,17 @@ class AppListServiceLinux : public AppListServiceImpl { |
| virtual Profile* GetCurrentAppListProfile() OVERRIDE; |
| virtual AppListControllerDelegate* GetControllerDelegate() OVERRIDE; |
| - // AppListServiceImpl overrides: |
| - virtual void CreateShortcut() OVERRIDE; |
| + // AppListCreatorDelegate overrides: |
|
tapted
2014/04/29 04:20:30
oops
Matt Giuca
2014/04/30 00:41:23
The Oops is to change this to AppListControllerDel
tapted
2014/04/30 03:26:03
close! AppListShowerDelegate.
Done.
|
| + virtual AppListControllerDelegate* GetControllerDelegateForCreate() OVERRIDE; |
| private: |
| - friend struct DefaultSingletonTraits<AppListServiceLinux>; |
| - |
| - AppListServiceLinux(); |
| + // Responsible for creating the app list and responding to profile changes. |
| + AppListShower shower_; |
| - // Responsible for putting views on the screen. |
| - scoped_ptr<AppListShower> shower_; |
| + bool can_dismiss_; |
| scoped_ptr<AppListControllerDelegate> controller_delegate_; |
| - DISALLOW_COPY_AND_ASSIGN(AppListServiceLinux); |
| + DISALLOW_COPY_AND_ASSIGN(AppListServiceViews); |
| }; |
| -#endif // CHROME_BROWSER_UI_VIEWS_APP_LIST_LINUX_APP_LIST_SERVICE_LINUX_H_ |
| +#endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ |