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->Initialize(nullptr /* parent */, current_apps_page); | 67 view->InitAsBubble(nullptr /* parent */, current_apps_page); |
68 | 68 view->SetAnchorPoint( |
69 view->MaybeSetAnchorPoint( | |
70 GetCenterOfDisplay(display_id, GetMinimumBoundsHeightForAppList(view))); | 69 GetCenterOfDisplay(display_id, GetMinimumBoundsHeightForAppList(view))); |
71 | 70 |
72 // TODO(mfomitchev): Setup updating bounds on keyboard bounds change. | 71 // TODO(mfomitchev): Setup updating bounds on keyboard bounds change. |
73 // TODO(mfomitchev): Setup dismissing on maximize (touch-view) mode start/end. | 72 // TODO(mfomitchev): Setup dismissing on maximize (touch-view) mode start/end. |
74 // TODO(mfomitchev): Setup DnD. | 73 // TODO(mfomitchev): Setup DnD. |
75 // TODO(mfomitchev): UpdateAutoHideState for shelf | 74 // TODO(mfomitchev): UpdateAutoHideState for shelf |
76 } | 75 } |
77 | 76 |
78 void AppListPresenterDelegateMus::OnShown(int64_t display_id) { | 77 void AppListPresenterDelegateMus::OnShown(int64_t display_id) { |
79 views::MusClient::Get()->pointer_watcher_event_router()->AddPointerWatcher( | 78 views::MusClient::Get()->pointer_watcher_event_router()->AddPointerWatcher( |
(...skipping 24 matching lines...) Expand all Loading... |
104 void AppListPresenterDelegateMus::OnPointerEventObserved( | 103 void AppListPresenterDelegateMus::OnPointerEventObserved( |
105 const ui::PointerEvent& event, | 104 const ui::PointerEvent& event, |
106 const gfx::Point& location_in_screen, | 105 const gfx::Point& location_in_screen, |
107 views::Widget* target) { | 106 views::Widget* target) { |
108 // Dismiss app list on a mouse click or touch outside of the app list window. | 107 // Dismiss app list on a mouse click or touch outside of the app list window. |
109 if ((event.type() == ui::ET_TOUCH_PRESSED || | 108 if ((event.type() == ui::ET_TOUCH_PRESSED || |
110 event.type() == ui::ET_POINTER_DOWN) && | 109 event.type() == ui::ET_POINTER_DOWN) && |
111 (!target || (view_ && (target != view_->GetWidget())))) | 110 (!target || (view_ && (target != view_->GetWidget())))) |
112 presenter_->Dismiss(); | 111 presenter_->Dismiss(); |
113 } | 112 } |
OLD | NEW |