Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(661)

Unified Diff: chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc

Issue 2651733002: IME for Mus: Avoid crash in InitWindowCandidateView(). (Closed)
Patch Set: addressed feedback. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc
diff --git a/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc b/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc
index 1c84d3988b895173fd8b6b1841a272104866a5a8..a291ad186993bed52c50f46eafd41783da8533b3 100644
--- a/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc
+++ b/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc
@@ -12,6 +12,7 @@
#include "ash/wm/window_util.h"
#include "base/logging.h"
#include "chrome/browser/chromeos/input_method/mode_indicator_controller.h"
+#include "chrome/browser/ui/ash/ash_util.h"
#include "ui/base/ime/ime_bridge.h"
#include "ui/chromeos/ime/infolist_window.h"
#include "ui/views/widget/widget.h"
@@ -44,12 +45,19 @@ void CandidateWindowControllerImpl::InitCandidateWindowView() {
if (candidate_window_view_)
return;
- aura::Window* active_window = ash::wm::GetActiveWindow();
- candidate_window_view_ =
- new ui::ime::CandidateWindowView(ash::Shell::GetContainer(
- active_window ? active_window->GetRootWindow()
- : ash::Shell::GetTargetRootWindow(),
- ash::kShellWindowId_SettingBubbleContainer));
+ // TODO(moshayedi): crbug.com/684658. Setting parent is nullptr in mash is
+ // just for the sake of not crashing. It doesn't provide the same behaviour
+ // as we have in ChromeOS. For example, candidate pop-up disappears when
+ // dragging the window in mash, but it shouldn't.
+ gfx::NativeView parent = nullptr;
+ if (!chrome::IsRunningInMash()) {
+ aura::Window* active_window = ash::wm::GetActiveWindow();
+ parent = ash::Shell::GetContainer(
+ active_window ? active_window->GetRootWindow()
+ : ash::Shell::GetTargetRootWindow(),
+ ash::kShellWindowId_SettingBubbleContainer);
+ }
+ candidate_window_view_ = new ui::ime::CandidateWindowView(parent);
candidate_window_view_->AddObserver(this);
candidate_window_view_->SetCursorBounds(cursor_bounds_, composition_head_);
views::Widget* widget = candidate_window_view_->InitWidget();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698