Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Side by Side Diff: chrome/browser/ui/ash/app_list/app_list_presenter_delegate_mus.h

Issue 2364173002: Add app_list_presenterr pointer in app_list_presenter_delegate_mus to use dismiss function (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_MUS_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_MUS_H_
6 #define CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_MUS_H_ 6 #define CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_MUS_H_
7 7
8 #include "ui/app_list/presenter/app_list_presenter_delegate.h" 8 #include "ui/app_list/presenter/app_list_presenter_delegate.h"
9 #include "ui/app_list/presenter/app_list_presenter.h"
10 #include "base/macros.h"
9 11
10 #include "base/macros.h" 12 #include "ui/views/pointer_watcher.h"
13 #include "ash/common/wm_shell.h"
14 #include "ui/views/mus/pointer_watcher_event_router.h"
11 15
12 namespace app_list { 16 namespace app_list {
13 class AppListView; 17 class AppListView;
18 class AppListPresenter;
14 class AppListViewDelegateFactory; 19 class AppListViewDelegateFactory;
15 } 20 }
16 21
17 // Mus+ash implementation of AppListPresetnerDelegate. 22 // Mus+ash implementation of AppListPresetnerDelegate.
18 // Responsible for laying out the app list UI as well as dismissing the app list 23 // Responsible for laying out the app list UI as well as dismissing the app list
19 // on in response to certain events (e.g. on mouse/touch gesture outside of the 24 // on in response to certain events (e.g. on mouse/touch gesture outside of the
20 // app list bounds). 25 // app list bounds).
21 class AppListPresenterDelegateMus : public app_list::AppListPresenterDelegate { 26 class AppListPresenterDelegateMus : public app_list::AppListPresenterDelegate,
27 public views::PointerWatcher {
22 public: 28 public:
23 explicit AppListPresenterDelegateMus( 29 explicit AppListPresenterDelegateMus(
30 app_list::AppListPresenter* presenter,
24 app_list::AppListViewDelegateFactory* view_delegate_factory); 31 app_list::AppListViewDelegateFactory* view_delegate_factory);
32
25 ~AppListPresenterDelegateMus() override; 33 ~AppListPresenterDelegateMus() override;
26 34
27 // app_list::AppListPresenterDelegate: 35 // app_list::AppListPresenterDelegate:
28 app_list::AppListViewDelegate* GetViewDelegate() override; 36 app_list::AppListViewDelegate* GetViewDelegate() override;
29 void Init(app_list::AppListView* view, 37 void Init(app_list::AppListView* view,
30 int64_t display_id, 38 int64_t display_id,
31 int current_apps_page) override; 39 int current_apps_page) override;
32 void OnShown(int64_t display_id) override; 40 void OnShown(int64_t display_id) override;
33 void OnDismissed() override; 41 void OnDismissed() override;
34 void UpdateBounds() override; 42 void UpdateBounds() override;
43
35 gfx::Vector2d GetVisibilityAnimationOffset( 44 gfx::Vector2d GetVisibilityAnimationOffset(
36 aura::Window* root_window) override; 45 aura::Window* root_window) override;
37 46
47 void OnPointerEventObserved(const ui::PointerEvent& event,
48 const gfx::Point& location_in_screen,
49 views::Widget* target) override;
50
38 private: 51 private:
39 // Whether the app list is visible (or in the process of being shown). 52 // Whether the app list is visible (or in the process of being shown).
40 bool is_visible_ = false; 53 bool is_visible_ = false;
41 54
42 // Not owned. Pointer is guaranteed to be valid while this object is alive. 55 // Not owned. Pointer is guaranteed to be valid while this object is alive.
43 app_list::AppListViewDelegateFactory* view_delegate_factory_; 56 app_list::AppListViewDelegateFactory* view_delegate_factory_;
44 57
45 // The current AppListView, owned by its widget. 58 // The current AppListView, owned by its widget.
46 app_list::AppListView* view_ = nullptr; 59 app_list::AppListView* view_ = nullptr;
60 app_list::AppListPresenter* presenter_;
47 61
48 DISALLOW_COPY_AND_ASSIGN(AppListPresenterDelegateMus); 62 DISALLOW_COPY_AND_ASSIGN(AppListPresenterDelegateMus);
49 }; 63 };
50 64
51 #endif // CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_MUS_H_ 65 #endif // CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_MUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698