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_controller.h" | 5 #include "chrome/browser/chromeos/input_method/mode_indicator_controller.h" |
6 | 6 |
7 #include "ash/ime/mode_indicator_view.h" | 7 #include "ash/ime/mode_indicator_view.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // notification. Note, launch bar can be vertical and can be placed | 97 // notification. Note, launch bar can be vertical and can be placed |
98 // right/left side of display. | 98 // right/left side of display. |
99 if (!is_focused_) | 99 if (!is_focused_) |
100 return; | 100 return; |
101 | 101 |
102 // Get the short name of the changed input method (e.g. US, JA, etc.) | 102 // Get the short name of the changed input method (e.g. US, JA, etc.) |
103 const InputMethodDescriptor descriptor = imm_->GetCurrentInputMethod(); | 103 const InputMethodDescriptor descriptor = imm_->GetCurrentInputMethod(); |
104 const base::string16 short_name = | 104 const base::string16 short_name = |
105 imm_->GetInputMethodUtil()->GetInputMethodShortName(descriptor); | 105 imm_->GetInputMethodUtil()->GetInputMethodShortName(descriptor); |
106 | 106 |
107 aura::Window* parent = ash::Shell::GetContainer( | 107 aura::Window* parent = |
108 ash::wm::GetActiveWindow()->GetRootWindow(), | 108 ash::Shell::GetContainer(ash::wm::GetActiveWindow()->GetRootWindow(), |
109 ash::internal::kShellWindowId_InputMethodContainer); | 109 ash::kShellWindowId_InputMethodContainer); |
110 ash::ime::ModeIndicatorView* mi_view = new ash::ime::ModeIndicatorView( | 110 ash::ime::ModeIndicatorView* mi_view = new ash::ime::ModeIndicatorView( |
111 parent, cursor_bounds_, short_name); | 111 parent, cursor_bounds_, short_name); |
112 views::BubbleDelegateView::CreateBubble(mi_view); | 112 views::BubbleDelegateView::CreateBubble(mi_view); |
113 | 113 |
114 views::Widget* mi_widget = mi_view->GetWidget(); | 114 views::Widget* mi_widget = mi_view->GetWidget(); |
115 if (GetModeIndicatorObserverForTesting()) | 115 if (GetModeIndicatorObserverForTesting()) |
116 GetModeIndicatorObserverForTesting()->AddModeIndicatorWidget(mi_widget); | 116 GetModeIndicatorObserverForTesting()->AddModeIndicatorWidget(mi_widget); |
117 | 117 |
118 mi_observer_->AddModeIndicatorWidget(mi_widget); | 118 mi_observer_->AddModeIndicatorWidget(mi_widget); |
119 mi_view->ShowAndFadeOut(); | 119 mi_view->ShowAndFadeOut(); |
120 } | 120 } |
121 | 121 |
122 } // namespace input_method | 122 } // namespace input_method |
123 } // namespace chromeos | 123 } // namespace chromeos |
OLD | NEW |