| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |