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

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: Move AddPointerWatcher object to constructor to ensure object existance for destructor. Fix format … 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 "base/macros.h"
8 #include "ui/app_list/presenter/app_list_presenter_delegate.h" 9 #include "ui/app_list/presenter/app_list_presenter_delegate.h"
9 10 #include "ui/views/pointer_watcher.h"
10 #include "base/macros.h"
11 11
12 namespace app_list { 12 namespace app_list {
13 class AppListView; 13 class AppListView;
14 class AppListPresenter;
14 class AppListViewDelegateFactory; 15 class AppListViewDelegateFactory;
15 } 16 }
16 17
17 // Mus+ash implementation of AppListPresetnerDelegate. 18 // Mus+ash implementation of AppListPresetnerDelegate.
18 // Responsible for laying out the app list UI as well as dismissing the app list 19 // 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 20 // on in response to certain events (e.g. on mouse/touch gesture outside of the
20 // app list bounds). 21 // app list bounds).
21 class AppListPresenterDelegateMus : public app_list::AppListPresenterDelegate { 22 class AppListPresenterDelegateMus : public app_list::AppListPresenterDelegate,
23 public views::PointerWatcher {
22 public: 24 public:
23 explicit AppListPresenterDelegateMus( 25 AppListPresenterDelegateMus(
26 app_list::AppListPresenter* presenter,
24 app_list::AppListViewDelegateFactory* view_delegate_factory); 27 app_list::AppListViewDelegateFactory* view_delegate_factory);
28
mfomitchev 2016/09/30 16:36:14 remove blank line
thanhph 2016/09/30 17:49:23 done!
25 ~AppListPresenterDelegateMus() override; 29 ~AppListPresenterDelegateMus() override;
26 30
27 // app_list::AppListPresenterDelegate: 31 // app_list::AppListPresenterDelegate:
28 app_list::AppListViewDelegate* GetViewDelegate() override; 32 app_list::AppListViewDelegate* GetViewDelegate() override;
29 void Init(app_list::AppListView* view, 33 void Init(app_list::AppListView* view,
30 int64_t display_id, 34 int64_t display_id,
31 int current_apps_page) override; 35 int current_apps_page) override;
32 void OnShown(int64_t display_id) override; 36 void OnShown(int64_t display_id) override;
33 void OnDismissed() override; 37 void OnDismissed() override;
34 void UpdateBounds() override; 38 void UpdateBounds() override;
35 gfx::Vector2d GetVisibilityAnimationOffset( 39 gfx::Vector2d GetVisibilityAnimationOffset(
36 aura::Window* root_window) override; 40 aura::Window* root_window) override;
37 41
38 private: 42 private:
43 // views::PointerWatcher:
44 void OnPointerEventObserved(const ui::PointerEvent& event,
45 const gfx::Point& location_in_screen,
46 views::Widget* target) override;
47
39 // Whether the app list is visible (or in the process of being shown). 48 // Whether the app list is visible (or in the process of being shown).
40 bool is_visible_ = false; 49 bool is_visible_ = false;
41 50
42 // Not owned. Pointer is guaranteed to be valid while this object is alive. 51 // Not owned. Pointer is guaranteed to be valid while this object is alive.
52 app_list::AppListPresenter* presenter_;
53
54 // Not owned. Pointer is guaranteed to be valid while this object is alive.
43 app_list::AppListViewDelegateFactory* view_delegate_factory_; 55 app_list::AppListViewDelegateFactory* view_delegate_factory_;
44 56
45 // The current AppListView, owned by its widget. 57 // The current AppListView, owned by its widget.
46 app_list::AppListView* view_ = nullptr; 58 app_list::AppListView* view_ = nullptr;
47 59
48 DISALLOW_COPY_AND_ASSIGN(AppListPresenterDelegateMus); 60 DISALLOW_COPY_AND_ASSIGN(AppListPresenterDelegateMus);
49 }; 61 };
50 62
51 #endif // CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_MUS_H_ 63 #endif // CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_MUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698