summaryrefslogtreecommitdiffstats
path: root/ash/ime
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-11 23:01:51 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-11 23:01:51 +0000
commite9f4146fbda8e664e4f598fe75152e9f3cc46028 (patch)
tree570a3db79ba5f52a9fc8130f224dc87d6872ea76 /ash/ime
parente5525186d9231c4639ee7f8a6a1815469609ee4b (diff)
downloadchromium_src-e9f4146fbda8e664e4f598fe75152e9f3cc46028.zip
chromium_src-e9f4146fbda8e664e4f598fe75152e9f3cc46028.tar.gz
chromium_src-e9f4146fbda8e664e4f598fe75152e9f3cc46028.tar.bz2
Let ModeIndicator ignore the shelf-space.
BUG=340348 R=nona@chromium.org TEST=manually Review URL: https://codereview.chromium.org/143073010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250538 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/ime')
-rw-r--r--ash/ime/mode_indicator_view.cc30
-rw-r--r--ash/ime/mode_indicator_view.h4
2 files changed, 34 insertions, 0 deletions
diff --git a/ash/ime/mode_indicator_view.cc b/ash/ime/mode_indicator_view.cc
index 64c9b24..0be5c15 100644
--- a/ash/ime/mode_indicator_view.cc
+++ b/ash/ime/mode_indicator_view.cc
@@ -5,7 +5,10 @@
#include "ash/ime/mode_indicator_view.h"
#include "base/logging.h"
+#include "ui/gfx/display.h"
+#include "ui/gfx/screen.h"
#include "ui/views/bubble/bubble_delegate.h"
+#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/corewm/window_animations.h"
#include "ui/views/layout/fill_layout.h"
@@ -20,6 +23,23 @@ const int kMinSize = 31;
// After this duration in msec, the mode inicator will be fading out.
const int kShowingDuration = 500;
+
+class ModeIndicatorFrameView : public views::BubbleFrameView {
+ public:
+ explicit ModeIndicatorFrameView(const gfx::Insets& content_margins)
+ : views::BubbleFrameView(content_margins) {}
+ virtual ~ModeIndicatorFrameView() {}
+
+ private:
+ // views::BubbleFrameView overrides:
+ virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect) OVERRIDE {
+ return gfx::Screen::GetNativeScreen()->GetDisplayNearestPoint(
+ rect.CenterPoint()).bounds();
+ }
+
+ DISALLOW_COPY_AND_ASSIGN(ModeIndicatorFrameView);
+};
+
} // namespace
@@ -65,5 +85,15 @@ void ModeIndicatorView::Init() {
SetAnchorRect(cursor_bounds_);
}
+views::NonClientFrameView* ModeIndicatorView::CreateNonClientFrameView(
+ views::Widget* widget) {
+ views::BubbleFrameView* frame = new ModeIndicatorFrameView(margins());
+ // arrow adjustment in BubbleDelegateView is unnecessary because arrow
+ // of this bubble is always center.
+ frame->SetBubbleBorder(scoped_ptr<views::BubbleBorder>(
+ new views::BubbleBorder(arrow(), shadow(), color())));
+ return frame;
+}
+
} // namespace ime
} // namespace ash
diff --git a/ash/ime/mode_indicator_view.h b/ash/ime/mode_indicator_view.h
index 2b3a8a8..7a95ea1 100644
--- a/ash/ime/mode_indicator_view.h
+++ b/ash/ime/mode_indicator_view.h
@@ -36,6 +36,10 @@ class ASH_EXPORT ModeIndicatorView : public views::BubbleDelegateView {
// views::BubbleDelegateView override:
virtual void Init() OVERRIDE;
+ // views::WidgetDelegateView overrides:
+ virtual views::NonClientFrameView* CreateNonClientFrameView(
+ views::Widget* widget) OVERRIDE;
+
private:
// Hide the window with fading animation. This is called from
// ShowAndFadeOut.