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 "chrome/browser/chromeos/input_method/candidate_window_controller_impl.
h" | 5 #include "chrome/browser/chromeos/input_method/candidate_window_controller_impl.
h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ime/infolist_window.h" | 10 #include "ash/ime/infolist_window.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 void CandidateWindowControllerImpl::InitCandidateWindowView() { | 43 void CandidateWindowControllerImpl::InitCandidateWindowView() { |
44 if (candidate_window_view_) | 44 if (candidate_window_view_) |
45 return; | 45 return; |
46 | 46 |
47 aura::Window* active_window = ash::wm::GetActiveWindow(); | 47 aura::Window* active_window = ash::wm::GetActiveWindow(); |
48 candidate_window_view_ = | 48 candidate_window_view_ = |
49 new ash::ime::CandidateWindowView(ash::Shell::GetContainer( | 49 new ash::ime::CandidateWindowView(ash::Shell::GetContainer( |
50 active_window ? | 50 active_window ? active_window->GetRootWindow() |
51 active_window->GetRootWindow() : ash::Shell::GetTargetRootWindow(), | 51 : ash::Shell::GetTargetRootWindow(), |
52 ash::internal::kShellWindowId_InputMethodContainer)); | 52 ash::kShellWindowId_InputMethodContainer)); |
53 candidate_window_view_->AddObserver(this); | 53 candidate_window_view_->AddObserver(this); |
54 candidate_window_view_->SetCursorBounds(cursor_bounds_, composition_head_); | 54 candidate_window_view_->SetCursorBounds(cursor_bounds_, composition_head_); |
55 views::Widget* widget = candidate_window_view_->InitWidget(); | 55 views::Widget* widget = candidate_window_view_->InitWidget(); |
56 widget->AddObserver(this); | 56 widget->AddObserver(this); |
57 widget->Show(); | 57 widget->Show(); |
58 FOR_EACH_OBSERVER(CandidateWindowController::Observer, observers_, | 58 FOR_EACH_OBSERVER(CandidateWindowController::Observer, observers_, |
59 CandidateWindowOpened()); | 59 CandidateWindowOpened()); |
60 } | 60 } |
61 | 61 |
62 void CandidateWindowControllerImpl::Hide() { | 62 void CandidateWindowControllerImpl::Hide() { |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 observers_.AddObserver(observer); | 189 observers_.AddObserver(observer); |
190 } | 190 } |
191 | 191 |
192 void CandidateWindowControllerImpl::RemoveObserver( | 192 void CandidateWindowControllerImpl::RemoveObserver( |
193 CandidateWindowController::Observer* observer) { | 193 CandidateWindowController::Observer* observer) { |
194 observers_.RemoveObserver(observer); | 194 observers_.RemoveObserver(observer); |
195 } | 195 } |
196 | 196 |
197 } // namespace input_method | 197 } // namespace input_method |
198 } // namespace chromeos | 198 } // namespace chromeos |
OLD | NEW |