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

Side by Side Diff: ash/app_list/app_list_view.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ash/app_list/app_list.cc ('k') | ash/monitor/monitor_controller.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 (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
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
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
OLDNEW
« no previous file with comments | « ash/app_list/app_list.cc ('k') | ash/monitor/monitor_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698