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

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: use forward declarations when possible add comments synchronize variable initialization order in co… 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 explicit AppListPresenterDelegateMus(
mfomitchev 2016/09/29 21:21:22 remove explicit
thanhph 2016/09/29 23:08:00 ok done!
26 app_list::AppListPresenter* presenter,
24 app_list::AppListViewDelegateFactory* view_delegate_factory); 27 app_list::AppListViewDelegateFactory* view_delegate_factory);
28
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;
39
mfomitchev 2016/09/29 21:21:22 remove blank line
35 gfx::Vector2d GetVisibilityAnimationOffset( 40 gfx::Vector2d GetVisibilityAnimationOffset(
36 aura::Window* root_window) override; 41 aura::Window* root_window) override;
37 42
38 private: 43 private:
44 // Receive callback events when users click/touch on a widget
mfomitchev 2016/09/29 21:21:22 The comment should be just // views::PointerWatch
thanhph 2016/09/29 23:08:00 cool thanks!
45 void OnPointerEventObserved(const ui::PointerEvent& event,
46 const gfx::Point& location_in_screen,
47 views::Widget* target) override;
48
39 // Whether the app list is visible (or in the process of being shown). 49 // Whether the app list is visible (or in the process of being shown).
40 bool is_visible_ = false; 50 bool is_visible_ = false;
41 51
42 // Not owned. Pointer is guaranteed to be valid while this object is alive. 52 // Not owned. Pointer is guaranteed to be valid while this object is alive.
53 app_list::AppListPresenter* presenter_;
54
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;
47 60
48 DISALLOW_COPY_AND_ASSIGN(AppListPresenterDelegateMus); 61 DISALLOW_COPY_AND_ASSIGN(AppListPresenterDelegateMus);
49 }; 62 };
50 63
51 #endif // CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_MUS_H_ 64 #endif // CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_PRESENTER_DELEGATE_MUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698