| 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/common/wm/panels/panel_layout_manager.h" | 5 #include "ash/common/wm/panels/panel_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "ash/common/shelf/wm_shelf.h" |
| 12 #include "ash/common/shelf/wm_shelf_util.h" |
| 11 #include "ash/common/shell_window_ids.h" | 13 #include "ash/common/shell_window_ids.h" |
| 12 #include "ash/common/wm/shelf/wm_shelf.h" | |
| 13 #include "ash/common/wm/shelf/wm_shelf_util.h" | |
| 14 #include "ash/common/wm/window_animation_types.h" | 14 #include "ash/common/wm/window_animation_types.h" |
| 15 #include "ash/common/wm/window_parenting_utils.h" | 15 #include "ash/common/wm/window_parenting_utils.h" |
| 16 #include "ash/common/wm/window_state.h" | 16 #include "ash/common/wm/window_state.h" |
| 17 #include "ash/common/wm_lookup.h" | 17 #include "ash/common/wm_lookup.h" |
| 18 #include "ash/common/wm_root_window_controller.h" | 18 #include "ash/common/wm_root_window_controller.h" |
| 19 #include "ash/common/wm_shell.h" | 19 #include "ash/common/wm_shell.h" |
| 20 #include "ash/common/wm_window.h" | 20 #include "ash/common/wm_window.h" |
| 21 #include "ash/common/wm_window_property.h" | 21 #include "ash/common/wm_window_property.h" |
| 22 #include "base/auto_reset.h" | 22 #include "base/auto_reset.h" |
| 23 #include "third_party/skia/include/core/SkColor.h" | 23 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 45 // Offset used when sliding panel in/out of the shelf. Used for minimizing, | 45 // Offset used when sliding panel in/out of the shelf. Used for minimizing, |
| 46 // restoring and the initial showing of a panel. | 46 // restoring and the initial showing of a panel. |
| 47 const int kPanelSlideInOffset = 20; | 47 const int kPanelSlideInOffset = 20; |
| 48 | 48 |
| 49 // Callout arrow dimensions. | 49 // Callout arrow dimensions. |
| 50 const int kArrowWidth = 18; | 50 const int kArrowWidth = 18; |
| 51 const int kArrowHeight = 9; | 51 const int kArrowHeight = 9; |
| 52 | 52 |
| 53 class CalloutWidgetBackground : public views::Background { | 53 class CalloutWidgetBackground : public views::Background { |
| 54 public: | 54 public: |
| 55 CalloutWidgetBackground() : alignment_(wm::SHELF_ALIGNMENT_BOTTOM) {} | 55 CalloutWidgetBackground() : alignment_(SHELF_ALIGNMENT_BOTTOM) {} |
| 56 | 56 |
| 57 void Paint(gfx::Canvas* canvas, views::View* view) const override { | 57 void Paint(gfx::Canvas* canvas, views::View* view) const override { |
| 58 SkPath path; | 58 SkPath path; |
| 59 switch (alignment_) { | 59 switch (alignment_) { |
| 60 case wm::SHELF_ALIGNMENT_BOTTOM: | 60 case SHELF_ALIGNMENT_BOTTOM: |
| 61 case wm::SHELF_ALIGNMENT_BOTTOM_LOCKED: | 61 case SHELF_ALIGNMENT_BOTTOM_LOCKED: |
| 62 path.moveTo(SkIntToScalar(0), SkIntToScalar(0)); | 62 path.moveTo(SkIntToScalar(0), SkIntToScalar(0)); |
| 63 path.lineTo(SkIntToScalar(kArrowWidth / 2), | 63 path.lineTo(SkIntToScalar(kArrowWidth / 2), |
| 64 SkIntToScalar(kArrowHeight)); | 64 SkIntToScalar(kArrowHeight)); |
| 65 path.lineTo(SkIntToScalar(kArrowWidth), SkIntToScalar(0)); | 65 path.lineTo(SkIntToScalar(kArrowWidth), SkIntToScalar(0)); |
| 66 break; | 66 break; |
| 67 case wm::SHELF_ALIGNMENT_LEFT: | 67 case SHELF_ALIGNMENT_LEFT: |
| 68 path.moveTo(SkIntToScalar(kArrowHeight), SkIntToScalar(kArrowWidth)); | 68 path.moveTo(SkIntToScalar(kArrowHeight), SkIntToScalar(kArrowWidth)); |
| 69 path.lineTo(SkIntToScalar(0), SkIntToScalar(kArrowWidth / 2)); | 69 path.lineTo(SkIntToScalar(0), SkIntToScalar(kArrowWidth / 2)); |
| 70 path.lineTo(SkIntToScalar(kArrowHeight), SkIntToScalar(0)); | 70 path.lineTo(SkIntToScalar(kArrowHeight), SkIntToScalar(0)); |
| 71 break; | 71 break; |
| 72 case wm::SHELF_ALIGNMENT_RIGHT: | 72 case SHELF_ALIGNMENT_RIGHT: |
| 73 path.moveTo(SkIntToScalar(0), SkIntToScalar(0)); | 73 path.moveTo(SkIntToScalar(0), SkIntToScalar(0)); |
| 74 path.lineTo(SkIntToScalar(kArrowHeight), | 74 path.lineTo(SkIntToScalar(kArrowHeight), |
| 75 SkIntToScalar(kArrowWidth / 2)); | 75 SkIntToScalar(kArrowWidth / 2)); |
| 76 path.lineTo(SkIntToScalar(0), SkIntToScalar(kArrowWidth)); | 76 path.lineTo(SkIntToScalar(0), SkIntToScalar(kArrowWidth)); |
| 77 break; | 77 break; |
| 78 } | 78 } |
| 79 // Hard code the arrow color for now. | 79 // Hard code the arrow color for now. |
| 80 SkPaint paint; | 80 SkPaint paint; |
| 81 paint.setStyle(SkPaint::kFill_Style); | 81 paint.setStyle(SkPaint::kFill_Style); |
| 82 paint.setColor(SkColorSetARGB(0xff, 0xe5, 0xe5, 0xe5)); | 82 paint.setColor(SkColorSetARGB(0xff, 0xe5, 0xe5, 0xe5)); |
| 83 canvas->DrawPath(path, paint); | 83 canvas->DrawPath(path, paint); |
| 84 } | 84 } |
| 85 | 85 |
| 86 wm::ShelfAlignment alignment() { return alignment_; } | 86 ShelfAlignment alignment() { return alignment_; } |
| 87 | 87 |
| 88 void set_alignment(wm::ShelfAlignment alignment) { alignment_ = alignment; } | 88 void set_alignment(ShelfAlignment alignment) { alignment_ = alignment; } |
| 89 | 89 |
| 90 private: | 90 private: |
| 91 wm::ShelfAlignment alignment_; | 91 ShelfAlignment alignment_; |
| 92 | 92 |
| 93 DISALLOW_COPY_AND_ASSIGN(CalloutWidgetBackground); | 93 DISALLOW_COPY_AND_ASSIGN(CalloutWidgetBackground); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 struct VisiblePanelPositionInfo { | 96 struct VisiblePanelPositionInfo { |
| 97 VisiblePanelPositionInfo() | 97 VisiblePanelPositionInfo() |
| 98 : min_major(0), | 98 : min_major(0), |
| 99 max_major(0), | 99 max_major(0), |
| 100 major_pos(0), | 100 major_pos(0), |
| 101 major_length(0), | 101 major_length(0), |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 std::max((*iter).min_major, std::min((*iter).max_major, major_pos)); | 153 std::max((*iter).min_major, std::min((*iter).max_major, major_pos)); |
| 154 major_pos += delta; | 154 major_pos += delta; |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 | 157 |
| 158 bool BoundsAdjacent(const gfx::Rect& bounds1, const gfx::Rect& bounds2) { | 158 bool BoundsAdjacent(const gfx::Rect& bounds1, const gfx::Rect& bounds2) { |
| 159 return bounds1.x() == bounds2.right() || bounds1.y() == bounds2.bottom() || | 159 return bounds1.x() == bounds2.right() || bounds1.y() == bounds2.bottom() || |
| 160 bounds1.right() == bounds2.x() || bounds1.bottom() == bounds2.y(); | 160 bounds1.right() == bounds2.x() || bounds1.bottom() == bounds2.y(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 gfx::Vector2d GetSlideInAnimationOffset(wm::ShelfAlignment alignment) { | 163 gfx::Vector2d GetSlideInAnimationOffset(ShelfAlignment alignment) { |
| 164 gfx::Vector2d offset; | 164 gfx::Vector2d offset; |
| 165 if (alignment == wm::SHELF_ALIGNMENT_LEFT) | 165 if (alignment == SHELF_ALIGNMENT_LEFT) |
| 166 offset.set_x(-kPanelSlideInOffset); | 166 offset.set_x(-kPanelSlideInOffset); |
| 167 else if (alignment == wm::SHELF_ALIGNMENT_RIGHT) | 167 else if (alignment == SHELF_ALIGNMENT_RIGHT) |
| 168 offset.set_x(kPanelSlideInOffset); | 168 offset.set_x(kPanelSlideInOffset); |
| 169 else | 169 else |
| 170 offset.set_y(kPanelSlideInOffset); | 170 offset.set_y(kPanelSlideInOffset); |
| 171 return offset; | 171 return offset; |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace | 174 } // namespace |
| 175 | 175 |
| 176 class PanelCalloutWidget : public views::Widget { | 176 class PanelCalloutWidget : public views::Widget { |
| 177 public: | 177 public: |
| 178 explicit PanelCalloutWidget(WmWindow* container) : background_(nullptr) { | 178 explicit PanelCalloutWidget(WmWindow* container) : background_(nullptr) { |
| 179 InitWidget(container); | 179 InitWidget(container); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void SetAlignment(wm::ShelfAlignment alignment) { | 182 void SetAlignment(ShelfAlignment alignment) { |
| 183 gfx::Rect callout_bounds = GetWindowBoundsInScreen(); | 183 gfx::Rect callout_bounds = GetWindowBoundsInScreen(); |
| 184 if (wm::IsHorizontalAlignment(alignment)) { | 184 if (IsHorizontalAlignment(alignment)) { |
| 185 callout_bounds.set_width(kArrowWidth); | 185 callout_bounds.set_width(kArrowWidth); |
| 186 callout_bounds.set_height(kArrowHeight); | 186 callout_bounds.set_height(kArrowHeight); |
| 187 } else { | 187 } else { |
| 188 callout_bounds.set_width(kArrowHeight); | 188 callout_bounds.set_width(kArrowHeight); |
| 189 callout_bounds.set_height(kArrowWidth); | 189 callout_bounds.set_height(kArrowWidth); |
| 190 } | 190 } |
| 191 SetBounds(callout_bounds); | 191 SetBounds(callout_bounds); |
| 192 if (background_->alignment() != alignment) { | 192 if (background_->alignment() != alignment) { |
| 193 background_->set_alignment(alignment); | 193 background_->set_alignment(alignment); |
| 194 SchedulePaintInRect(gfx::Rect(callout_bounds.size())); | 194 SchedulePaintInRect(gfx::Rect(callout_bounds.size())); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 DCHECK(!dragged_panel_); | 285 DCHECK(!dragged_panel_); |
| 286 dragged_panel_ = panel; | 286 dragged_panel_ = panel; |
| 287 Relayout(); | 287 Relayout(); |
| 288 } | 288 } |
| 289 | 289 |
| 290 void PanelLayoutManager::FinishDragging() { | 290 void PanelLayoutManager::FinishDragging() { |
| 291 dragged_panel_ = NULL; | 291 dragged_panel_ = NULL; |
| 292 Relayout(); | 292 Relayout(); |
| 293 } | 293 } |
| 294 | 294 |
| 295 void PanelLayoutManager::SetShelf(wm::WmShelf* shelf) { | 295 void PanelLayoutManager::SetShelf(WmShelf* shelf) { |
| 296 DCHECK(!shelf_); | 296 DCHECK(!shelf_); |
| 297 shelf_ = shelf; | 297 shelf_ = shelf; |
| 298 shelf_->AddObserver(this); | 298 shelf_->AddObserver(this); |
| 299 WillChangeVisibilityState(shelf_->GetVisibilityState()); | 299 WillChangeVisibilityState(shelf_->GetVisibilityState()); |
| 300 } | 300 } |
| 301 | 301 |
| 302 void PanelLayoutManager::ToggleMinimize(WmWindow* panel) { | 302 void PanelLayoutManager::ToggleMinimize(WmWindow* panel) { |
| 303 DCHECK(panel->GetParent() == panel_container_); | 303 DCHECK(panel->GetParent() == panel_container_); |
| 304 wm::WindowState* window_state = panel->GetWindowState(); | 304 wm::WindowState* window_state = panel->GetWindowState(); |
| 305 if (window_state->IsMinimized()) | 305 if (window_state->IsMinimized()) |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 // when the WindowSelectorController is restoring minimized windows so that | 580 // when the WindowSelectorController is restoring minimized windows so that |
| 581 // they actually become visible. | 581 // they actually become visible. |
| 582 WmShell* shell = panel_container_->GetShell(); | 582 WmShell* shell = panel_container_->GetShell(); |
| 583 if (in_layout_ || (shell->IsOverviewModeSelecting() && | 583 if (in_layout_ || (shell->IsOverviewModeSelecting() && |
| 584 !shell->IsOverviewModeRestoringMinimizedWindows())) { | 584 !shell->IsOverviewModeRestoringMinimizedWindows())) { |
| 585 return; | 585 return; |
| 586 } | 586 } |
| 587 | 587 |
| 588 base::AutoReset<bool> auto_reset_in_layout(&in_layout_, true); | 588 base::AutoReset<bool> auto_reset_in_layout(&in_layout_, true); |
| 589 | 589 |
| 590 const wm::ShelfAlignment alignment = shelf_->GetAlignment(); | 590 const ShelfAlignment alignment = shelf_->GetAlignment(); |
| 591 const bool horizontal = wm::IsHorizontalAlignment(shelf_->GetAlignment()); | 591 const bool horizontal = IsHorizontalAlignment(shelf_->GetAlignment()); |
| 592 gfx::Rect shelf_bounds = panel_container_->ConvertRectFromScreen( | 592 gfx::Rect shelf_bounds = panel_container_->ConvertRectFromScreen( |
| 593 shelf_->GetWindow()->GetBoundsInScreen()); | 593 shelf_->GetWindow()->GetBoundsInScreen()); |
| 594 int panel_start_bounds = kPanelIdealSpacing; | 594 int panel_start_bounds = kPanelIdealSpacing; |
| 595 int panel_end_bounds = | 595 int panel_end_bounds = |
| 596 horizontal ? panel_container_->GetBounds().width() - kPanelIdealSpacing | 596 horizontal ? panel_container_->GetBounds().width() - kPanelIdealSpacing |
| 597 : panel_container_->GetBounds().height() - kPanelIdealSpacing; | 597 : panel_container_->GetBounds().height() - kPanelIdealSpacing; |
| 598 WmWindow* active_panel = nullptr; | 598 WmWindow* active_panel = nullptr; |
| 599 std::vector<VisiblePanelPositionInfo> visible_panels; | 599 std::vector<VisiblePanelPositionInfo> visible_panels; |
| 600 for (PanelList::iterator iter = panel_windows_.begin(); | 600 for (PanelList::iterator iter = panel_windows_.begin(); |
| 601 iter != panel_windows_.end(); ++iter) { | 601 iter != panel_windows_.end(); ++iter) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 } | 672 } |
| 673 } | 673 } |
| 674 FanOutPanels(visible_panels.begin() + first_overlapping_panel, | 674 FanOutPanels(visible_panels.begin() + first_overlapping_panel, |
| 675 visible_panels.end()); | 675 visible_panels.end()); |
| 676 | 676 |
| 677 for (size_t i = 0; i < visible_panels.size(); ++i) { | 677 for (size_t i = 0; i < visible_panels.size(); ++i) { |
| 678 if (visible_panels[i].window == dragged_panel_) | 678 if (visible_panels[i].window == dragged_panel_) |
| 679 continue; | 679 continue; |
| 680 bool slide_in = visible_panels[i].slide_in; | 680 bool slide_in = visible_panels[i].slide_in; |
| 681 gfx::Rect bounds = visible_panels[i].window->GetTargetBounds(); | 681 gfx::Rect bounds = visible_panels[i].window->GetTargetBounds(); |
| 682 if (alignment == wm::SHELF_ALIGNMENT_LEFT) | 682 if (alignment == SHELF_ALIGNMENT_LEFT) |
| 683 bounds.set_x(shelf_bounds.right()); | 683 bounds.set_x(shelf_bounds.right()); |
| 684 else if (alignment == wm::SHELF_ALIGNMENT_RIGHT) | 684 else if (alignment == SHELF_ALIGNMENT_RIGHT) |
| 685 bounds.set_x(shelf_bounds.x() - bounds.width()); | 685 bounds.set_x(shelf_bounds.x() - bounds.width()); |
| 686 else | 686 else |
| 687 bounds.set_y(shelf_bounds.y() - bounds.height()); | 687 bounds.set_y(shelf_bounds.y() - bounds.height()); |
| 688 bool on_shelf = visible_panels[i].window->GetTargetBounds() == bounds; | 688 bool on_shelf = visible_panels[i].window->GetTargetBounds() == bounds; |
| 689 | 689 |
| 690 if (horizontal) { | 690 if (horizontal) { |
| 691 bounds.set_x(visible_panels[i].major_pos - | 691 bounds.set_x(visible_panels[i].major_pos - |
| 692 visible_panels[i].major_length / 2); | 692 visible_panels[i].major_length / 2); |
| 693 } else { | 693 } else { |
| 694 bounds.set_y(visible_panels[i].major_pos - | 694 bounds.set_y(visible_panels[i].major_pos - |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 // We want to to stack the panels like a deck of cards: | 739 // We want to to stack the panels like a deck of cards: |
| 740 // ,--,--,--,-------.--.--. | 740 // ,--,--,--,-------.--.--. |
| 741 // | | | | | | | | 741 // | | | | | | | |
| 742 // | | | | | | | | 742 // | | | | | | | |
| 743 // | 743 // |
| 744 // We use the middle of each panel to figure out how to stack the panels. This | 744 // We use the middle of each panel to figure out how to stack the panels. This |
| 745 // allows us to update the stacking when a panel is being dragged around by | 745 // allows us to update the stacking when a panel is being dragged around by |
| 746 // the titlebar--even though it doesn't update the shelf icon positions, we | 746 // the titlebar--even though it doesn't update the shelf icon positions, we |
| 747 // still want the visual effect. | 747 // still want the visual effect. |
| 748 std::map<int, WmWindow*> window_ordering; | 748 std::map<int, WmWindow*> window_ordering; |
| 749 const bool horizontal = wm::IsHorizontalAlignment(shelf_->GetAlignment()); | 749 const bool horizontal = IsHorizontalAlignment(shelf_->GetAlignment()); |
| 750 for (PanelList::const_iterator it = panel_windows_.begin(); | 750 for (PanelList::const_iterator it = panel_windows_.begin(); |
| 751 it != panel_windows_.end(); ++it) { | 751 it != panel_windows_.end(); ++it) { |
| 752 gfx::Rect bounds = it->window->GetBounds(); | 752 gfx::Rect bounds = it->window->GetBounds(); |
| 753 window_ordering.insert( | 753 window_ordering.insert( |
| 754 std::make_pair(horizontal ? bounds.x() + bounds.width() / 2 | 754 std::make_pair(horizontal ? bounds.x() + bounds.width() / 2 |
| 755 : bounds.y() + bounds.height() / 2, | 755 : bounds.y() + bounds.height() / 2, |
| 756 it->window)); | 756 it->window)); |
| 757 } | 757 } |
| 758 | 758 |
| 759 WmWindow* previous_panel = nullptr; | 759 WmWindow* previous_panel = nullptr; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 773 previous_panel = it->second; | 773 previous_panel = it->second; |
| 774 } | 774 } |
| 775 | 775 |
| 776 panel_container_->StackChildAtTop(active_panel); | 776 panel_container_->StackChildAtTop(active_panel); |
| 777 if (dragged_panel_ && dragged_panel_->GetParent() == panel_container_) | 777 if (dragged_panel_ && dragged_panel_->GetParent() == panel_container_) |
| 778 panel_container_->StackChildAtTop(dragged_panel_); | 778 panel_container_->StackChildAtTop(dragged_panel_); |
| 779 last_active_panel_ = active_panel; | 779 last_active_panel_ = active_panel; |
| 780 } | 780 } |
| 781 | 781 |
| 782 void PanelLayoutManager::UpdateCallouts() { | 782 void PanelLayoutManager::UpdateCallouts() { |
| 783 const bool horizontal = wm::IsHorizontalAlignment(shelf_->GetAlignment()); | 783 const bool horizontal = IsHorizontalAlignment(shelf_->GetAlignment()); |
| 784 for (PanelList::iterator iter = panel_windows_.begin(); | 784 for (PanelList::iterator iter = panel_windows_.begin(); |
| 785 iter != panel_windows_.end(); ++iter) { | 785 iter != panel_windows_.end(); ++iter) { |
| 786 WmWindow* panel = iter->window; | 786 WmWindow* panel = iter->window; |
| 787 views::Widget* callout_widget = iter->callout_widget; | 787 views::Widget* callout_widget = iter->callout_widget; |
| 788 WmWindow* callout_widget_window = | 788 WmWindow* callout_widget_window = |
| 789 WmLookup::Get()->GetWindowForWidget(callout_widget); | 789 WmLookup::Get()->GetWindowForWidget(callout_widget); |
| 790 | 790 |
| 791 gfx::Rect current_bounds = panel->GetBoundsInScreen(); | 791 gfx::Rect current_bounds = panel->GetBoundsInScreen(); |
| 792 gfx::Rect bounds = | 792 gfx::Rect bounds = |
| 793 panel->GetParent()->ConvertRectToScreen(panel->GetTargetBounds()); | 793 panel->GetParent()->ConvertRectToScreen(panel->GetTargetBounds()); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 810 std::max(current_bounds.x() - callout_bounds.x(), | 810 std::max(current_bounds.x() - callout_bounds.x(), |
| 811 callout_bounds.right() - current_bounds.right()); | 811 callout_bounds.right() - current_bounds.right()); |
| 812 } else { | 812 } else { |
| 813 callout_bounds.set_y(icon_bounds.y() + | 813 callout_bounds.set_y(icon_bounds.y() + |
| 814 (icon_bounds.height() - callout_bounds.height()) / | 814 (icon_bounds.height() - callout_bounds.height()) / |
| 815 2); | 815 2); |
| 816 distance_until_over_panel = | 816 distance_until_over_panel = |
| 817 std::max(current_bounds.y() - callout_bounds.y(), | 817 std::max(current_bounds.y() - callout_bounds.y(), |
| 818 callout_bounds.bottom() - current_bounds.bottom()); | 818 callout_bounds.bottom() - current_bounds.bottom()); |
| 819 } | 819 } |
| 820 if (shelf_->GetAlignment() == wm::SHELF_ALIGNMENT_LEFT) | 820 if (shelf_->GetAlignment() == SHELF_ALIGNMENT_LEFT) |
| 821 callout_bounds.set_x(bounds.x() - callout_bounds.width()); | 821 callout_bounds.set_x(bounds.x() - callout_bounds.width()); |
| 822 else if (shelf_->GetAlignment() == wm::SHELF_ALIGNMENT_RIGHT) | 822 else if (shelf_->GetAlignment() == SHELF_ALIGNMENT_RIGHT) |
| 823 callout_bounds.set_x(bounds.right()); | 823 callout_bounds.set_x(bounds.right()); |
| 824 else | 824 else |
| 825 callout_bounds.set_y(bounds.bottom()); | 825 callout_bounds.set_y(bounds.bottom()); |
| 826 callout_bounds = callout_widget_window->GetParent()->ConvertRectFromScreen( | 826 callout_bounds = callout_widget_window->GetParent()->ConvertRectFromScreen( |
| 827 callout_bounds); | 827 callout_bounds); |
| 828 | 828 |
| 829 callout_widget_window->SetBoundsDirect(callout_bounds); | 829 callout_widget_window->SetBoundsDirect(callout_bounds); |
| 830 panel_container_->StackChildAbove(callout_widget_window, panel); | 830 panel_container_->StackChildAbove(callout_widget_window, panel); |
| 831 | 831 |
| 832 ui::Layer* layer = callout_widget_window->GetLayer(); | 832 ui::Layer* layer = callout_widget_window->GetLayer(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 // Keyboard hidden, restore original bounds if they exist. | 889 // Keyboard hidden, restore original bounds if they exist. |
| 890 panel->SetBoundsDirect(panel_state->GetRestoreBoundsInScreen()); | 890 panel->SetBoundsDirect(panel_state->GetRestoreBoundsInScreen()); |
| 891 } | 891 } |
| 892 } | 892 } |
| 893 // This bounds change will have caused a change to the Shelf which does not | 893 // This bounds change will have caused a change to the Shelf which does not |
| 894 // propogate automatically to this class, so manually recalculate bounds. | 894 // propogate automatically to this class, so manually recalculate bounds. |
| 895 OnWindowResized(); | 895 OnWindowResized(); |
| 896 } | 896 } |
| 897 | 897 |
| 898 } // namespace ash | 898 } // namespace ash |
| OLD | NEW |