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

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

Issue 1136463005: Supports multiple profile in Chrome OS IMF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
Index: chrome/browser/chromeos/input_method/input_method_engine.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_engine.cc b/chrome/browser/chromeos/input_method/input_method_engine.cc
index 6d5ad0cafadeb581153274112db952ab50213699..3a0a01b3df442d16effcb0e2ab6a447c6b1610e2 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine.cc
+++ b/chrome/browser/chromeos/input_method/input_method_engine.cc
@@ -17,6 +17,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/ime/candidate_window.h"
@@ -162,7 +163,8 @@ InputMethodEngine::InputMethodEngine()
composition_cursor_(0),
candidate_window_(new ui::CandidateWindow()),
window_visible_(false),
- sent_key_event_(NULL) {
+ sent_key_event_(NULL),
+ profile_(NULL) {
}
InputMethodEngine::~InputMethodEngine() {
@@ -170,12 +172,14 @@ InputMethodEngine::~InputMethodEngine() {
void InputMethodEngine::Initialize(
scoped_ptr<InputMethodEngineInterface::Observer> observer,
- const char* extension_id) {
+ const char* extension_id,
+ Profile* profile) {
DCHECK(observer) << "Observer must not be null.";
// TODO(komatsu): It is probably better to set observer out of Initialize.
observer_ = observer.Pass();
extension_id_ = extension_id;
+ profile_ = profile;
}
const std::string& InputMethodEngine::GetActiveComponentId() const {
@@ -573,6 +577,8 @@ void InputMethodEngine::FocusOut() {
}
void InputMethodEngine::Enable(const std::string& component_id) {
+ if (!ProfileManager::GetActiveUserProfile()->IsSameProfile(profile_))
+ return;
DCHECK(!component_id.empty());
active_component_id_ = component_id;
observer_->OnActivate(component_id);
@@ -584,6 +590,8 @@ void InputMethodEngine::Enable(const std::string& component_id) {
}
void InputMethodEngine::Disable() {
+ if (!ProfileManager::GetActiveUserProfile()->IsSameProfile(profile_))
+ return;
active_component_id_.clear();
observer_->OnDeactivated(active_component_id_);
}

Powered by Google App Engine
This is Rietveld 408576698