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

Side by Side Diff: ash/wm/panel_layout_manager.cc

Issue 10795013: Rename bounds accessors to be intuitive and consistent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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/wm/frame_painter.cc ('k') | ash/wm/panel_layout_manager_unittest.cc » ('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/wm/panel_layout_manager.h" 5 #include "ash/wm/panel_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "ash/launcher/launcher.h" 10 #include "ash/launcher/launcher.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 //////////////////////////////////////////////////////////////////////////////// 243 ////////////////////////////////////////////////////////////////////////////////
244 // PanelLayoutManager private implementation: 244 // PanelLayoutManager private implementation:
245 void PanelLayoutManager::Relayout() { 245 void PanelLayoutManager::Relayout() {
246 if (!launcher_ || !launcher_->widget()) 246 if (!launcher_ || !launcher_->widget())
247 return; 247 return;
248 248
249 if (in_layout_) 249 if (in_layout_)
250 return; 250 return;
251 AutoReset<bool> auto_reset_in_layout(&in_layout_, true); 251 AutoReset<bool> auto_reset_in_layout(&in_layout_, true);
252 252
253 int launcher_top = launcher_->widget()->GetWindowScreenBounds().y(); 253 int launcher_top = launcher_->widget()->GetWindowBoundsInScreen().y();
254 aura::Window* active_panel = NULL; 254 aura::Window* active_panel = NULL;
255 for (PanelList::iterator iter = panel_windows_.begin(); 255 for (PanelList::iterator iter = panel_windows_.begin();
256 iter != panel_windows_.end(); ++iter) { 256 iter != panel_windows_.end(); ++iter) {
257 aura::Window* panel = *iter; 257 aura::Window* panel = *iter;
258 if (!panel->IsVisible() || panel == dragged_panel_) 258 if (!panel->IsVisible() || panel == dragged_panel_)
259 continue; 259 continue;
260 260
261 gfx::Rect icon_bounds = 261 gfx::Rect icon_bounds =
262 launcher_->GetScreenBoundsOfItemIconForWindow(panel); 262 launcher_->GetScreenBoundsOfItemIconForWindow(panel);
263 263
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 } 346 }
347 MessageLoop::current()->PostTask( 347 MessageLoop::current()->PostTask(
348 FROM_HERE, 348 FROM_HERE,
349 base::Bind(&PanelLayoutManager::ShowCalloutHelper, 349 base::Bind(&PanelLayoutManager::ShowCalloutHelper,
350 weak_factory_.GetWeakPtr(), 350 weak_factory_.GetWeakPtr(),
351 active_panel)); 351 active_panel));
352 } 352 }
353 353
354 void PanelLayoutManager::ShowCalloutHelper(aura::Window* active_panel) { 354 void PanelLayoutManager::ShowCalloutHelper(aura::Window* active_panel) {
355 DCHECK(active_panel); 355 DCHECK(active_panel);
356 gfx::Rect bounds = active_panel->GetRootWindowBounds(); 356 gfx::Rect bounds = active_panel->GetBoundsInRootWindow();
357 gfx::Rect callout_bounds = callout_widget_->GetWindowScreenBounds(); 357 gfx::Rect callout_bounds = callout_widget_->GetWindowBoundsInScreen();
358 callout_bounds.set_x( 358 callout_bounds.set_x(
359 bounds.x() + (bounds.width() - callout_bounds.width()) / 2); 359 bounds.x() + (bounds.width() - callout_bounds.width()) / 2);
360 callout_bounds.set_y(bounds.bottom()); 360 callout_bounds.set_y(bounds.bottom());
361 SetChildBoundsDirect(callout_widget_->GetNativeWindow(), callout_bounds); 361 SetChildBoundsDirect(callout_widget_->GetNativeWindow(), callout_bounds);
362 panel_container_->StackChildAtTop(callout_widget_->GetNativeWindow()); 362 panel_container_->StackChildAtTop(callout_widget_->GetNativeWindow());
363 callout_widget_->Show(); 363 callout_widget_->Show();
364 } 364 }
365 365
366 } // namespace internal 366 } // namespace internal
367 } // namespace ash 367 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/frame_painter.cc ('k') | ash/wm/panel_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698