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/wm/panels/panel_layout_manager.h" | 5 #include "ash/wm/panels/panel_layout_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // Callout arrow dimensions. | 57 // Callout arrow dimensions. |
58 const int kArrowWidth = 18; | 58 const int kArrowWidth = 18; |
59 const int kArrowHeight = 9; | 59 const int kArrowHeight = 9; |
60 | 60 |
61 class CalloutWidgetBackground : public views::Background { | 61 class CalloutWidgetBackground : public views::Background { |
62 public: | 62 public: |
63 CalloutWidgetBackground() : alignment_(SHELF_ALIGNMENT_BOTTOM) { | 63 CalloutWidgetBackground() : alignment_(SHELF_ALIGNMENT_BOTTOM) { |
64 } | 64 } |
65 | 65 |
66 virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE { | 66 virtual void Paint(gfx::Canvas* canvas, views::View* view) const override { |
67 SkPath path; | 67 SkPath path; |
68 switch (alignment_) { | 68 switch (alignment_) { |
69 case SHELF_ALIGNMENT_BOTTOM: | 69 case SHELF_ALIGNMENT_BOTTOM: |
70 path.moveTo(SkIntToScalar(0), SkIntToScalar(0)); | 70 path.moveTo(SkIntToScalar(0), SkIntToScalar(0)); |
71 path.lineTo(SkIntToScalar(kArrowWidth / 2), | 71 path.lineTo(SkIntToScalar(kArrowWidth / 2), |
72 SkIntToScalar(kArrowHeight)); | 72 SkIntToScalar(kArrowHeight)); |
73 path.lineTo(SkIntToScalar(kArrowWidth), SkIntToScalar(0)); | 73 path.lineTo(SkIntToScalar(kArrowWidth), SkIntToScalar(0)); |
74 break; | 74 break; |
75 case SHELF_ALIGNMENT_LEFT: | 75 case SHELF_ALIGNMENT_LEFT: |
76 path.moveTo(SkIntToScalar(kArrowHeight), SkIntToScalar(kArrowWidth)); | 76 path.moveTo(SkIntToScalar(kArrowHeight), SkIntToScalar(kArrowWidth)); |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 // Keyboard hidden, restore original bounds if they exist. | 936 // Keyboard hidden, restore original bounds if they exist. |
937 SetChildBounds(panel, panel_state->GetRestoreBoundsInScreen()); | 937 SetChildBounds(panel, panel_state->GetRestoreBoundsInScreen()); |
938 } | 938 } |
939 } | 939 } |
940 // This bounds change will have caused a change to the Shelf which does not | 940 // This bounds change will have caused a change to the Shelf which does not |
941 // propogate automatically to this class, so manually recalculate bounds. | 941 // propogate automatically to this class, so manually recalculate bounds. |
942 OnWindowResized(); | 942 OnWindowResized(); |
943 } | 943 } |
944 | 944 |
945 } // namespace ash | 945 } // namespace ash |
OLD | NEW |