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 ScreenUtil::ConvertRectFromScreen( | 98 ScreenUtil::ConvertRectFromScreen( |
99 shelf_widget()->GetNativeView(), | 99 shelf_widget()->GetNativeView(), |
100 window->GetBoundsInScreen()).CenterPoint()); | 100 window->GetBoundsInScreen()).CenterPoint()); |
101 } | 101 } |
102 | 102 |
103 void Shelf::ActivateShelfItem(int index) { | 103 void Shelf::ActivateShelfItem(int index) { |
104 // We pass in a keyboard event which will then trigger a switch to the | 104 // We pass in a keyboard event which will then trigger a switch to the |
105 // next item if the current one is already active. | 105 // next item if the current one is already active. |
106 ui::KeyEvent event(ui::ET_KEY_RELEASED, | 106 ui::KeyEvent event(ui::ET_KEY_RELEASED, |
107 ui::VKEY_UNKNOWN, // The actual key gets ignored. | 107 ui::VKEY_UNKNOWN, // The actual key gets ignored. |
108 ui::EF_NONE, | 108 ui::EF_NONE); |
109 false); | |
110 | 109 |
111 const ShelfItem& item = shelf_view_->model()->items()[index]; | 110 const ShelfItem& item = shelf_view_->model()->items()[index]; |
112 ShelfItemDelegate* item_delegate = | 111 ShelfItemDelegate* item_delegate = |
113 Shell::GetInstance()->shelf_item_delegate_manager()->GetShelfItemDelegate( | 112 Shell::GetInstance()->shelf_item_delegate_manager()->GetShelfItemDelegate( |
114 item.id); | 113 item.id); |
115 item_delegate->ItemSelected(event); | 114 item_delegate->ItemSelected(event); |
116 } | 115 } |
117 | 116 |
118 void Shelf::CycleWindowLinear(CycleDirection direction) { | 117 void Shelf::CycleWindowLinear(CycleDirection direction) { |
119 int item_index = GetNextActivatedItemIndex( | 118 int item_index = GetNextActivatedItemIndex( |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 188 |
190 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { | 189 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { |
191 return shelf_view_->GetVisibleItemsBoundsInScreen(); | 190 return shelf_view_->GetVisibleItemsBoundsInScreen(); |
192 } | 191 } |
193 | 192 |
194 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { | 193 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { |
195 return shelf_view_; | 194 return shelf_view_; |
196 } | 195 } |
197 | 196 |
198 } // namespace ash | 197 } // namespace ash |
OLD | NEW |