| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shelf/shelf.h" | 5 #include "ash/shelf/shelf.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "ash/focus_cycler.h" | 10 #include "ash/focus_cycler.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 void Shelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) { | 98 void Shelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) { |
| 99 if (auto_hide_behavior_ == auto_hide_behavior) | 99 if (auto_hide_behavior_ == auto_hide_behavior) |
| 100 return; | 100 return; |
| 101 | 101 |
| 102 auto_hide_behavior_ = auto_hide_behavior; | 102 auto_hide_behavior_ = auto_hide_behavior; |
| 103 delegate_->OnShelfAutoHideBehaviorChanged(this); | 103 delegate_->OnShelfAutoHideBehaviorChanged(this); |
| 104 Shell::GetInstance()->OnShelfAutoHideBehaviorChanged( | 104 Shell::GetInstance()->OnShelfAutoHideBehaviorChanged( |
| 105 shelf_widget_->GetNativeWindow()->GetRootWindow()); | 105 shelf_widget_->GetNativeWindow()->GetRootWindow()); |
| 106 } | 106 } |
| 107 | 107 |
| 108 ShelfAutoHideBehavior Shelf::GetAutoHideBehavior() const { | |
| 109 return auto_hide_behavior_; | |
| 110 } | |
| 111 | |
| 112 gfx::Rect Shelf::GetScreenBoundsOfItemIconForWindow( | 108 gfx::Rect Shelf::GetScreenBoundsOfItemIconForWindow( |
| 113 const aura::Window* window) { | 109 const aura::Window* window) { |
| 114 ShelfID id = GetShelfIDForWindow(window); | 110 ShelfID id = GetShelfIDForWindow(window); |
| 115 gfx::Rect bounds(shelf_view_->GetIdealBoundsOfItemIcon(id)); | 111 gfx::Rect bounds(shelf_view_->GetIdealBoundsOfItemIcon(id)); |
| 116 gfx::Point screen_origin; | 112 gfx::Point screen_origin; |
| 117 views::View::ConvertPointToScreen(shelf_view_, &screen_origin); | 113 views::View::ConvertPointToScreen(shelf_view_, &screen_origin); |
| 118 return gfx::Rect(screen_origin.x() + bounds.x(), | 114 return gfx::Rect(screen_origin.x() + bounds.x(), |
| 119 screen_origin.y() + bounds.y(), | 115 screen_origin.y() + bounds.y(), |
| 120 bounds.width(), | 116 bounds.width(), |
| 121 bounds.height()); | 117 bounds.height()); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 205 |
| 210 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { | 206 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { |
| 211 return shelf_view_->GetVisibleItemsBoundsInScreen(); | 207 return shelf_view_->GetVisibleItemsBoundsInScreen(); |
| 212 } | 208 } |
| 213 | 209 |
| 214 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { | 210 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { |
| 215 return shelf_view_; | 211 return shelf_view_; |
| 216 } | 212 } |
| 217 | 213 |
| 218 } // namespace ash | 214 } // namespace ash |
| OLD | NEW |