| 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/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 void CandidateWindowControllerImpl::InitCandidateWindowView() { | 44 void CandidateWindowControllerImpl::InitCandidateWindowView() { |
| 45 if (candidate_window_view_) | 45 if (candidate_window_view_) |
| 46 return; | 46 return; |
| 47 | 47 |
| 48 // TODO(moshayedi): crbug.com/684658. Setting parent is nullptr in mash is | 48 // TODO(moshayedi): crbug.com/684658. Setting parent is nullptr in mash is |
| 49 // just for the sake of not crashing. It doesn't provide the same behaviour | 49 // just for the sake of not crashing. It doesn't provide the same behaviour |
| 50 // as we have in ChromeOS. For example, candidate pop-up disappears when | 50 // as we have in ChromeOS. For example, candidate pop-up disappears when |
| 51 // dragging the window in mash, but it shouldn't. | 51 // dragging the window in mash, but it shouldn't. |
| 52 gfx::NativeView parent = nullptr; | 52 gfx::NativeView parent = nullptr; |
| 53 if (!ash_util::IsRunningInMash()) { | 53 if (!IsRunningInMash()) { |
| 54 aura::Window* active_window = ash::wm::GetActiveWindow(); | 54 aura::Window* active_window = ash::wm::GetActiveWindow(); |
| 55 parent = ash::Shell::GetContainer( | 55 parent = ash::Shell::GetContainer( |
| 56 active_window ? active_window->GetRootWindow() | 56 active_window ? active_window->GetRootWindow() |
| 57 : ash::Shell::GetTargetRootWindow(), | 57 : ash::Shell::GetTargetRootWindow(), |
| 58 ash::kShellWindowId_SettingBubbleContainer); | 58 ash::kShellWindowId_SettingBubbleContainer); |
| 59 } | 59 } |
| 60 candidate_window_view_ = new ui::ime::CandidateWindowView(parent); | 60 candidate_window_view_ = new ui::ime::CandidateWindowView(parent); |
| 61 candidate_window_view_->AddObserver(this); | 61 candidate_window_view_->AddObserver(this); |
| 62 candidate_window_view_->SetCursorBounds(cursor_bounds_, composition_head_); | 62 candidate_window_view_->SetCursorBounds(cursor_bounds_, composition_head_); |
| 63 views::Widget* widget = candidate_window_view_->InitWidget(); | 63 views::Widget* widget = candidate_window_view_->InitWidget(); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 observers_.AddObserver(observer); | 199 observers_.AddObserver(observer); |
| 200 } | 200 } |
| 201 | 201 |
| 202 void CandidateWindowControllerImpl::RemoveObserver( | 202 void CandidateWindowControllerImpl::RemoveObserver( |
| 203 CandidateWindowController::Observer* observer) { | 203 CandidateWindowController::Observer* observer) { |
| 204 observers_.RemoveObserver(observer); | 204 observers_.RemoveObserver(observer); |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace input_method | 207 } // namespace input_method |
| 208 } // namespace chromeos | 208 } // namespace chromeos |
| OLD | NEW |