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

Side by Side Diff: ash/app_list/app_list_presenter_delegate.cc

Issue 2934673002: Revert of Draggable peeking/fullscreen launcher with transparent background. (Closed)
Patch Set: Created 3 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/app_list/app_list_presenter_delegate.h" 5 #include "ash/app_list/app_list_presenter_delegate.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/public/cpp/shelf_types.h" 8 #include "ash/public/cpp/shelf_types.h"
9 #include "ash/public/cpp/shell_window_ids.h" 9 #include "ash/public/cpp/shell_window_ids.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 // By setting us as DnD recipient, the app list knows that we can 113 // By setting us as DnD recipient, the app list knows that we can
114 // handle items. 114 // handle items.
115 Shelf* shelf = Shelf::ForWindow(root_window); 115 Shelf* shelf = Shelf::ForWindow(root_window);
116 view->SetDragAndDropHostOfCurrentAppList( 116 view->SetDragAndDropHostOfCurrentAppList(
117 shelf->shelf_widget()->GetDragAndDropHostForAppList()); 117 shelf->shelf_widget()->GetDragAndDropHostForAppList());
118 } 118 }
119 119
120 void AppListPresenterDelegate::OnShown(int64_t display_id) { 120 void AppListPresenterDelegate::OnShown(int64_t display_id) {
121 is_visible_ = true; 121 is_visible_ = true;
122 // Update applist button status when app list visibility is changed.
122 aura::Window* root_window = 123 aura::Window* root_window =
123 ShellPort::Get()->GetRootWindowForDisplayId(display_id); 124 ShellPort::Get()->GetRootWindowForDisplayId(display_id);
124 Shell::Get()->OnAppListVisibilityChanged(is_visible_, root_window); 125 AppListButton* app_list_button =
126 Shelf::ForWindow(root_window)->shelf_widget()->GetAppListButton();
127 if (app_list_button)
128 app_list_button->OnAppListShown();
125 } 129 }
126 130
127 void AppListPresenterDelegate::OnDismissed() { 131 void AppListPresenterDelegate::OnDismissed() {
128 DCHECK(is_visible_); 132 DCHECK(is_visible_);
129 DCHECK(view_); 133 DCHECK(view_);
130 134
131 is_visible_ = false; 135 is_visible_ = false;
132 aura::Window* root_window = 136
133 RootWindowController::ForTargetRootWindow()->GetRootWindow(); 137 // Update applist button status when app list visibility is changed.
134 Shell::Get()->OnAppListVisibilityChanged(is_visible_, root_window); 138 Shelf* shelf = Shelf::ForWindow(view_->GetWidget()->GetNativeWindow());
139 AppListButton* app_list_button = shelf->shelf_widget()->GetAppListButton();
140 if (app_list_button)
141 app_list_button->OnAppListDismissed();
135 } 142 }
136 143
137 void AppListPresenterDelegate::UpdateBounds() { 144 void AppListPresenterDelegate::UpdateBounds() {
138 if (!view_ || !is_visible_) 145 if (!view_ || !is_visible_)
139 return; 146 return;
140 147
141 view_->UpdateBounds(); 148 view_->UpdateBounds();
142 view_->MaybeSetAnchorPoint( 149 view_->MaybeSetAnchorPoint(
143 GetCenterOfDisplayForWindow(view_->GetWidget()->GetNativeWindow(), 150 GetCenterOfDisplayForWindow(view_->GetWidget()->GetNativeWindow(),
144 GetMinimumBoundsHeightForAppList(view_))); 151 GetMinimumBoundsHeightForAppList(view_)));
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 void AppListPresenterDelegate::OnKeyboardClosed() {} 230 void AppListPresenterDelegate::OnKeyboardClosed() {}
224 231
225 //////////////////////////////////////////////////////////////////////////////// 232 ////////////////////////////////////////////////////////////////////////////////
226 // AppListPresenterDelegate, ShellObserver implementation: 233 // AppListPresenterDelegate, ShellObserver implementation:
227 void AppListPresenterDelegate::OnOverviewModeStarting() { 234 void AppListPresenterDelegate::OnOverviewModeStarting() {
228 if (is_visible_) 235 if (is_visible_)
229 presenter_->Dismiss(); 236 presenter_->Dismiss();
230 } 237 }
231 238
232 } // namespace ash 239 } // namespace ash
OLDNEW
« no previous file with comments | « ash/app_list/app_list_delegate_impl.cc ('k') | ash/app_list/app_list_presenter_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698