OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/chromeos/ime/mode_indicator_view.h" | 5 #include "ui/chromeos/ime/mode_indicator_view.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "ui/gfx/display.h" | 9 #include "ui/gfx/display.h" |
10 #include "ui/gfx/screen.h" | 10 #include "ui/gfx/screen.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 class ModeIndicatorFrameView : public views::BubbleFrameView { | 28 class ModeIndicatorFrameView : public views::BubbleFrameView { |
29 public: | 29 public: |
30 explicit ModeIndicatorFrameView(const gfx::Insets& content_margins) | 30 explicit ModeIndicatorFrameView(const gfx::Insets& content_margins) |
31 : views::BubbleFrameView(content_margins) {} | 31 : views::BubbleFrameView(content_margins) {} |
32 ~ModeIndicatorFrameView() override {} | 32 ~ModeIndicatorFrameView() override {} |
33 | 33 |
34 private: | 34 private: |
35 // views::BubbleFrameView overrides: | 35 // views::BubbleFrameView overrides: |
36 gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect) const override { | 36 gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect) const override { |
37 return gfx::Screen::GetNativeScreen()->GetDisplayNearestPoint( | 37 return gfx::Screen::GetScreen() |
38 rect.CenterPoint()).bounds(); | 38 ->GetDisplayNearestPoint(rect.CenterPoint()) |
| 39 .bounds(); |
39 } | 40 } |
40 | 41 |
41 DISALLOW_COPY_AND_ASSIGN(ModeIndicatorFrameView); | 42 DISALLOW_COPY_AND_ASSIGN(ModeIndicatorFrameView); |
42 }; | 43 }; |
43 | 44 |
44 } // namespace | 45 } // namespace |
45 | 46 |
46 | 47 |
47 ModeIndicatorView::ModeIndicatorView(gfx::NativeView parent, | 48 ModeIndicatorView::ModeIndicatorView(gfx::NativeView parent, |
48 const gfx::Rect& cursor_bounds, | 49 const gfx::Rect& cursor_bounds, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 views::BubbleFrameView* frame = new ModeIndicatorFrameView(margins()); | 92 views::BubbleFrameView* frame = new ModeIndicatorFrameView(margins()); |
92 // arrow adjustment in BubbleDelegateView is unnecessary because arrow | 93 // arrow adjustment in BubbleDelegateView is unnecessary because arrow |
93 // of this bubble is always center. | 94 // of this bubble is always center. |
94 frame->SetBubbleBorder(scoped_ptr<views::BubbleBorder>( | 95 frame->SetBubbleBorder(scoped_ptr<views::BubbleBorder>( |
95 new views::BubbleBorder(arrow(), shadow(), color()))); | 96 new views::BubbleBorder(arrow(), shadow(), color()))); |
96 return frame; | 97 return frame; |
97 } | 98 } |
98 | 99 |
99 } // namespace ime | 100 } // namespace ime |
100 } // namespace ui | 101 } // namespace ui |
OLD | NEW |