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

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

Issue 428783008: GetActiveUserProfile() should not be called before profile is initialized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment on GetProfile added. Created 6 years, 4 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 47a3c5a904eeccd9f4a942a4185fd6d4f9f5c0d8..271f095c7410c62c1910f17a0549ddd32cab1be0 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine.cc
+++ b/chrome/browser/chromeos/input_method/input_method_engine.cc
@@ -119,15 +119,19 @@ 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() {
if (start_time_.ToInternalValue())
RecordHistogram("WorkingTime", (end_time_ - start_time_).InSeconds());
- input_method::InputMethodManager::Get()->RemoveInputMethodExtension(imm_id_);
+ input_method::InputMethodManager::Get()->RemoveInputMethodExtension(profile_,
+ imm_id_);
}
void InputMethodEngine::Initialize(
+ Profile* profile,
scoped_ptr<InputMethodEngineInterface::Observer> observer,
const char* engine_name,
const char* extension_id,
@@ -138,6 +142,8 @@ void InputMethodEngine::Initialize(
const GURL& input_view) {
DCHECK(observer) << "Observer must not be null.";
+ profile_ = profile;
+
// TODO(komatsu): It is probably better to set observer out of Initialize.
observer_ = observer.Pass();
engine_id_ = engine_id;
@@ -168,7 +174,7 @@ void InputMethodEngine::Initialize(
// TODO(komatsu): It is probably better to call AddInputMethodExtension
// out of Initialize.
- manager->AddInputMethodExtension(imm_id_, this);
+ manager->AddInputMethodExtension(profile, imm_id_, this);
}
const input_method::InputMethodDescriptor& InputMethodEngine::GetDescriptor()

Powered by Google App Engine
This is Rietveld 408576698