OLD | NEW |
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_view.h" | 5 #include "ash/app_list/app_list_view.h" |
6 | 6 |
7 #include "ash/app_list/app_list_item_view.h" | 7 #include "ash/app_list/app_list_item_view.h" |
8 #include "ash/app_list/app_list_model.h" | 8 #include "ash/app_list/app_list_model.h" |
9 #include "ash/app_list/app_list_model_view.h" | 9 #include "ash/app_list/app_list_model_view.h" |
10 #include "ash/app_list/app_list_view_delegate.h" | 10 #include "ash/app_list/app_list_view_delegate.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 | 118 |
119 void AppListView::Layout() { | 119 void AppListView::Layout() { |
120 gfx::Rect rect(GetContentsBounds()); | 120 gfx::Rect rect(GetContentsBounds()); |
121 if (rect.IsEmpty()) | 121 if (rect.IsEmpty()) |
122 return; | 122 return; |
123 | 123 |
124 // Gets work area rect, which is in screen coordinates. | 124 // Gets work area rect, which is in screen coordinates. |
125 gfx::Rect workarea = Shell::GetInstance()->shelf()->IsVisible() ? | 125 gfx::Rect workarea = Shell::GetInstance()->shelf()->IsVisible() ? |
126 ScreenAsh::GetUnmaximizedWorkAreaBounds(GetWidget()->GetNativeView()) : | 126 ScreenAsh::GetUnmaximizedWorkAreaBounds(GetWidget()->GetNativeView()) : |
127 gfx::Screen::GetMonitorWorkAreaNearestWindow( | 127 gfx::Screen::GetMonitorNearestWindow( |
128 GetWidget()->GetNativeView()); | 128 GetWidget()->GetNativeView()).work_area(); |
129 | 129 |
130 // Converts |workarea| into view's coordinates. | 130 // Converts |workarea| into view's coordinates. |
131 gfx::Point origin(workarea.origin()); | 131 gfx::Point origin(workarea.origin()); |
132 views::View::ConvertPointFromScreen(this, &origin); | 132 views::View::ConvertPointFromScreen(this, &origin); |
133 workarea.Offset(-origin.x(), -origin.y()); | 133 workarea.Offset(-origin.x(), -origin.y()); |
134 | 134 |
135 rect = rect.Intersect(workarea); | 135 rect = rect.Intersect(workarea); |
136 model_view_->SetBoundsRect(rect); | 136 model_view_->SetBoundsRect(rect); |
137 } | 137 } |
138 | 138 |
(...skipping 20 matching lines...) Expand all Loading... |
159 | 159 |
160 if (delegate_.get()) { | 160 if (delegate_.get()) { |
161 delegate_->OnAppListItemActivated( | 161 delegate_->OnAppListItemActivated( |
162 static_cast<AppListItemView*>(sender)->model(), | 162 static_cast<AppListItemView*>(sender)->model(), |
163 event.flags()); | 163 event.flags()); |
164 } | 164 } |
165 Close(); | 165 Close(); |
166 } | 166 } |
167 | 167 |
168 } // namespace ash | 168 } // namespace ash |
OLD | NEW |