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

Side by Side Diff: ash/common/shelf/shelf_widget.cc

Issue 2288993002: ash: Move AppList support to ShelfWidget, expose ShelfWidget in WmShelf (Closed)
Patch Set: missed one unit test Created 4 years, 3 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
« no previous file with comments | « ash/common/shelf/shelf_widget.h ('k') | ash/common/shelf/wm_shelf.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/common/shelf/shelf_widget.h" 5 #include "ash/common/shelf/shelf_widget.h"
6 6
7 #include "ash/common/focus_cycler.h" 7 #include "ash/common/focus_cycler.h"
8 #include "ash/common/material_design/material_design_controller.h" 8 #include "ash/common/material_design/material_design_controller.h"
9 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/shelf/shelf_background_animator_observer.h" 10 #include "ash/common/shelf/shelf_background_animator_observer.h"
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 gfx::Rect ShelfWidget::GetScreenBoundsOfItemIconForWindow(WmWindow* window) { 514 gfx::Rect ShelfWidget::GetScreenBoundsOfItemIconForWindow(WmWindow* window) {
515 ShelfID id = window->GetIntProperty(WmWindowProperty::SHELF_ID); 515 ShelfID id = window->GetIntProperty(WmWindowProperty::SHELF_ID);
516 gfx::Rect bounds(shelf_view_->GetIdealBoundsOfItemIcon(id)); 516 gfx::Rect bounds(shelf_view_->GetIdealBoundsOfItemIcon(id));
517 gfx::Point screen_origin; 517 gfx::Point screen_origin;
518 views::View::ConvertPointToScreen(shelf_view_, &screen_origin); 518 views::View::ConvertPointToScreen(shelf_view_, &screen_origin);
519 return gfx::Rect(screen_origin.x() + bounds.x(), 519 return gfx::Rect(screen_origin.x() + bounds.x(),
520 screen_origin.y() + bounds.y(), bounds.width(), 520 screen_origin.y() + bounds.y(), bounds.width(),
521 bounds.height()); 521 bounds.height());
522 } 522 }
523 523
524 AppListButton* ShelfWidget::GetAppListButton() const {
525 return shelf_view_->GetAppListButton();
526 }
527
528 app_list::ApplicationDragAndDropHost*
529 ShelfWidget::GetDragAndDropHostForAppList() {
530 return shelf_view_;
531 }
532
524 void ShelfWidget::OnWidgetActivationChanged(views::Widget* widget, 533 void ShelfWidget::OnWidgetActivationChanged(views::Widget* widget,
525 bool active) { 534 bool active) {
526 activating_as_fallback_ = false; 535 activating_as_fallback_ = false;
527 if (active) 536 if (active)
528 delegate_view_->SetPaneFocusAndFocusDefault(); 537 delegate_view_->SetPaneFocusAndFocusDefault();
529 else 538 else
530 delegate_view_->GetFocusManager()->ClearFocus(); 539 delegate_view_->GetFocusManager()->ClearFocus();
531 } 540 }
532 541
533 int ShelfWidget::GetDimmingAlphaForTest() { 542 int ShelfWidget::GetDimmingAlphaForTest() {
(...skipping 17 matching lines...) Expand all
551 if (shelf_view_) 560 if (shelf_view_)
552 shelf_view_->UpdateShelfItemBackground(alpha); 561 shelf_view_->UpdateShelfItemBackground(alpha);
553 } 562 }
554 563
555 void ShelfWidget::WillDeleteShelfLayoutManager() { 564 void ShelfWidget::WillDeleteShelfLayoutManager() {
556 shelf_layout_manager_->RemoveObserver(this); 565 shelf_layout_manager_->RemoveObserver(this);
557 shelf_layout_manager_ = nullptr; 566 shelf_layout_manager_ = nullptr;
558 } 567 }
559 568
560 } // namespace ash 569 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_widget.h ('k') | ash/common/shelf/wm_shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698