| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/chromeos/input_method/mode_indicator_delegate_view.h" | 5 #include "chrome/browser/chromeos/input_method/mode_indicator_delegate_view.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "ash/wm/window_animations.h" | 9 #include "ash/wm/window_animations.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // indicator is shown above the cursor instead on bottom. | 25 // indicator is shown above the cursor instead on bottom. |
| 26 const int kSizeMargin = 75; | 26 const int kSizeMargin = 75; |
| 27 | 27 |
| 28 // After this duration in msec, the mode inicator will be fading out. | 28 // After this duration in msec, the mode inicator will be fading out. |
| 29 const int kShowingDuration = 500; | 29 const int kShowingDuration = 500; |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| 32 | 32 |
| 33 ModeIndicatorDelegateView::ModeIndicatorDelegateView( | 33 ModeIndicatorDelegateView::ModeIndicatorDelegateView( |
| 34 const gfx::Rect& cursor_bounds, | 34 const gfx::Rect& cursor_bounds, |
| 35 const string16& label) | 35 const base::string16& label) |
| 36 : cursor_bounds_(cursor_bounds), | 36 : cursor_bounds_(cursor_bounds), |
| 37 label_view_(new views::Label(label)) { | 37 label_view_(new views::Label(label)) { |
| 38 set_use_focusless(true); | 38 set_use_focusless(true); |
| 39 set_accept_events(false); | 39 set_accept_events(false); |
| 40 set_parent_window( | 40 set_parent_window( |
| 41 ash::Shell::GetContainer( | 41 ash::Shell::GetContainer( |
| 42 ash::wm::GetActiveWindow()->GetRootWindow(), | 42 ash::wm::GetActiveWindow()->GetRootWindow(), |
| 43 ash::internal::kShellWindowId_InputMethodContainer)); | 43 ash::internal::kShellWindowId_InputMethodContainer)); |
| 44 set_shadow(views::BubbleBorder::NO_SHADOW); | 44 set_shadow(views::BubbleBorder::NO_SHADOW); |
| 45 | 45 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 void ModeIndicatorDelegateView::Init() { | 84 void ModeIndicatorDelegateView::Init() { |
| 85 SetLayoutManager(new views::FillLayout()); | 85 SetLayoutManager(new views::FillLayout()); |
| 86 AddChildView(label_view_); | 86 AddChildView(label_view_); |
| 87 | 87 |
| 88 SetAnchorRect(cursor_bounds_); | 88 SetAnchorRect(cursor_bounds_); |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace input_method | 91 } // namespace input_method |
| 92 } // namespace chromeos | 92 } // namespace chromeos |
| OLD | NEW |