| Index: chrome/browser/ui/app_list/app_list_service_views_mac.h
|
| diff --git a/chrome/browser/ui/app_list/app_list_service_views_mac.h b/chrome/browser/ui/app_list/app_list_service_views_mac.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7e6398f86b5d020ab755fffcc1c403229a9f7a13
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/app_list/app_list_service_views_mac.h
|
| @@ -0,0 +1,72 @@
|
| +// Copyright 2015 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_APP_LIST_APP_LIST_SERVICE_VIEWS_MAC_H_
|
| +#define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_MAC_H_
|
| +
|
| +#include "chrome/browser/ui/app_list/app_list_service_mac.h"
|
| +#include "chrome/browser/ui/app_list/app_list_service_views.h"
|
| +#include "ui/app_list/app_list_switches.h"
|
| +#include "ui/app_list/views/app_list_view_observer.h"
|
| +
|
| +class AppListServiceViewsMac;
|
| +template <typename T>
|
| +struct DefaultSingletonTraits;
|
| +
|
| +class AppListServiceViewsBridge : public AppListServiceViews,
|
| + public app_list::AppListViewObserver {
|
| + public:
|
| + AppListServiceViewsBridge(AppListServiceViewsMac* owner);
|
| +
|
| + // AppListService overrides:
|
| + void DismissAppList() override;
|
| +
|
| + // AppListShowerDelegate overrides:
|
| + void OnViewCreated() override;
|
| + void OnViewBeingDestroyed() override;
|
| + void OnViewDismissed() override;
|
| + void MoveNearCursor(app_list::AppListView* view) override;
|
| +
|
| + // app_list::AppListViewObserver overrides:
|
| + void OnActivationChanged(views::Widget* widget, bool active) override;
|
| +
|
| + private:
|
| + AppListServiceViewsMac* owner_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(AppListServiceViewsBridge);
|
| +};
|
| +
|
| +// AppListServiceViewsMac extends the Mac AppListService with a bridge for
|
| +// showing the app list backed by toolkit-views.
|
| +class AppListServiceViewsMac : public AppListServiceMac {
|
| + public:
|
| + ~AppListServiceViewsMac() override;
|
| +
|
| + static AppListServiceViewsMac* GetInstance();
|
| +
|
| + // AppListService overrides:
|
| + void ShowForProfile(Profile* requested_profile) override;
|
| + Profile* GetCurrentAppListProfile() override;
|
| + AppListControllerDelegate* GetControllerDelegate() override;
|
| +
|
| + // AppListServiceImpl overrides:
|
| + void CreateForProfile(Profile* requested_profile) override;
|
| + void DestroyAppList() override;
|
| +
|
| + protected:
|
| + // AppListServceMac overrides:
|
| + NSWindow* GetNativeWindow() const override;
|
| + bool ReadyToShow() override;
|
| +
|
| + private:
|
| + friend struct DefaultSingletonTraits<AppListServiceViewsMac>;
|
| +
|
| + AppListServiceViewsMac();
|
| +
|
| + AppListServiceViewsBridge bridge_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(AppListServiceViewsMac);
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_MAC_H_
|
|
|