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

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

Issue 12213111: Fix right edge bounds for panel position. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | « no previous file | 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 aura::client::GetFocusClient(panel)->GetFocusedWindow())) { 364 aura::client::GetFocusClient(panel)->GetFocusedWindow())) {
365 DCHECK(!active_panel); 365 DCHECK(!active_panel);
366 active_panel = panel; 366 active_panel = panel;
367 } 367 }
368 icon_bounds = ScreenAsh::ConvertRectFromScreen(panel_container_, 368 icon_bounds = ScreenAsh::ConvertRectFromScreen(panel_container_,
369 icon_bounds); 369 icon_bounds);
370 gfx::Point icon_origin = icon_bounds.origin(); 370 gfx::Point icon_origin = icon_bounds.origin();
371 VisiblePanelPositionInfo position_info; 371 VisiblePanelPositionInfo position_info;
372 position_info.min_x = std::max(panel_left_bounds, icon_origin.x() + 372 position_info.min_x = std::max(panel_left_bounds, icon_origin.x() +
373 icon_bounds.width() - panel->bounds().width()); 373 icon_bounds.width() - panel->bounds().width());
374 position_info.max_x = std::min(icon_origin.x(), panel_right_bounds - 374 position_info.max_x = std::min(icon_origin.x(),
375 kPanelIdealSpacing); 375 panel_right_bounds - kPanelIdealSpacing -
376 panel->bounds().width());
376 position_info.x = icon_origin.x() + icon_bounds.width() / 2 - 377 position_info.x = icon_origin.x() + icon_bounds.width() / 2 -
377 panel->bounds().width() / 2; 378 panel->bounds().width() / 2;
378 position_info.width = panel->bounds().width(); 379 position_info.width = panel->bounds().width();
379 position_info.window = panel; 380 position_info.window = panel;
380 visible_panels.push_back(position_info); 381 visible_panels.push_back(position_info);
381 } 382 }
382 383
383 // Sort panels by their X positions and fan out groups of overlapping panels. 384 // Sort panels by their X positions and fan out groups of overlapping panels.
384 // The fan out method may result in new overlapping panels however given that 385 // The fan out method may result in new overlapping panels however given that
385 // the panels start at least a full panel width apart this overlap will 386 // the panels start at least a full panel width apart this overlap will
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 callout_widget_->GetNativeWindow()->parent(), 488 callout_widget_->GetNativeWindow()->parent(),
488 callout_bounds); 489 callout_bounds);
489 490
490 SetChildBoundsDirect(callout_widget_->GetNativeWindow(), callout_bounds); 491 SetChildBoundsDirect(callout_widget_->GetNativeWindow(), callout_bounds);
491 panel_container_->StackChildAtTop(callout_widget_->GetNativeWindow()); 492 panel_container_->StackChildAtTop(callout_widget_->GetNativeWindow());
492 callout_widget_->Show(); 493 callout_widget_->Show();
493 } 494 }
494 495
495 } // namespace internal 496 } // namespace internal
496 } // namespace ash 497 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wm/panel_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698