OLD | NEW |
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 #include "chrome/browser/ui/ash/app_list/app_list_presenter_delegate_mus.h" | 5 #include "chrome/browser/ui/ash/app_list/app_list_presenter_delegate_mus.h" |
6 | 6 |
7 #include "ui/app_list/presenter/app_list_presenter_impl.h" | 7 #include "ui/app_list/presenter/app_list_presenter_impl.h" |
8 #include "ui/app_list/presenter/app_list_view_delegate_factory.h" | 8 #include "ui/app_list/presenter/app_list_view_delegate_factory.h" |
9 #include "ui/app_list/views/app_list_view.h" | 9 #include "ui/app_list/views/app_list_view.h" |
10 #include "ui/display/display.h" | 10 #include "ui/display/display.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 int64_t display_id, | 57 int64_t display_id, |
58 int current_apps_page) { | 58 int current_apps_page) { |
59 view_ = view; | 59 view_ = view; |
60 | 60 |
61 // Note: This would place the app list into the USER_WINDOWS container, unlike | 61 // Note: This would place the app list into the USER_WINDOWS container, unlike |
62 // in classic ash, where it has it's own container. | 62 // in classic ash, where it has it's own container. |
63 // TODO(mfomitchev): We are currently passing NULL for |parent|. It seems like | 63 // TODO(mfomitchev): We are currently passing NULL for |parent|. It seems like |
64 // the only thing this is used for is choosing the right scale factor in | 64 // the only thing this is used for is choosing the right scale factor in |
65 // AppListMainView::PreloadIcons(), so we take care of that - perhaps by | 65 // AppListMainView::PreloadIcons(), so we take care of that - perhaps by |
66 // passing the display_id or the scale factor directly | 66 // passing the display_id or the scale factor directly |
67 view->InitAsBubble(nullptr /* parent */, current_apps_page); | 67 view->Initialize(nullptr /* parent */, current_apps_page); |
68 view->SetAnchorPoint( | 68 |
| 69 view->MaybeSetAnchorPoint( |
69 GetCenterOfDisplay(display_id, GetMinimumBoundsHeightForAppList(view))); | 70 GetCenterOfDisplay(display_id, GetMinimumBoundsHeightForAppList(view))); |
70 | 71 |
71 // TODO(mfomitchev): Setup updating bounds on keyboard bounds change. | 72 // TODO(mfomitchev): Setup updating bounds on keyboard bounds change. |
72 // TODO(mfomitchev): Setup dismissing on maximize (touch-view) mode start/end. | 73 // TODO(mfomitchev): Setup dismissing on maximize (touch-view) mode start/end. |
73 // TODO(mfomitchev): Setup DnD. | 74 // TODO(mfomitchev): Setup DnD. |
74 // TODO(mfomitchev): UpdateAutoHideState for shelf | 75 // TODO(mfomitchev): UpdateAutoHideState for shelf |
75 } | 76 } |
76 | 77 |
77 void AppListPresenterDelegateMus::OnShown(int64_t display_id) { | 78 void AppListPresenterDelegateMus::OnShown(int64_t display_id) { |
78 views::MusClient::Get()->pointer_watcher_event_router()->AddPointerWatcher( | 79 views::MusClient::Get()->pointer_watcher_event_router()->AddPointerWatcher( |
(...skipping 24 matching lines...) Expand all Loading... |
103 void AppListPresenterDelegateMus::OnPointerEventObserved( | 104 void AppListPresenterDelegateMus::OnPointerEventObserved( |
104 const ui::PointerEvent& event, | 105 const ui::PointerEvent& event, |
105 const gfx::Point& location_in_screen, | 106 const gfx::Point& location_in_screen, |
106 views::Widget* target) { | 107 views::Widget* target) { |
107 // Dismiss app list on a mouse click or touch outside of the app list window. | 108 // Dismiss app list on a mouse click or touch outside of the app list window. |
108 if ((event.type() == ui::ET_TOUCH_PRESSED || | 109 if ((event.type() == ui::ET_TOUCH_PRESSED || |
109 event.type() == ui::ET_POINTER_DOWN) && | 110 event.type() == ui::ET_POINTER_DOWN) && |
110 (!target || (view_ && (target != view_->GetWidget())))) | 111 (!target || (view_ && (target != view_->GetWidget())))) |
111 presenter_->Dismiss(); | 112 presenter_->Dismiss(); |
112 } | 113 } |
OLD | NEW |