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

Unified Diff: chrome/browser/extensions/api/input_ime/input_ime_api.cc

Issue 418273002: Leverage OnFocus event to let component IME extension know about the current screen type (e.g. logi… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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/extensions/api/input_ime/input_ime_api.cc
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.cc b/chrome/browser/extensions/api/input_ime/input_ime_api.cc
index b35997b4cc6de409e4fbbcce37f2634897ca521a..dcd6ba4689de31ef4587e4a9eb670f65912ffee0 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_api.cc
+++ b/chrome/browser/extensions/api/input_ime/input_ime_api.cc
@@ -6,6 +6,8 @@
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
+#include "chrome/browser/chromeos/login/lock/screen_locker.h"
+#include "chrome/browser/chromeos/login/users/user_manager.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -144,6 +146,22 @@ class ImeObserver : public InputMethodEngineInterface::Observer {
scoped_ptr<base::ListValue> args(input_ime::OnFocus::Create(context_value));
+ // The component IME extensions need to know the current screen type (e.g.
+ // lock screen, login screen, etc.) so that its on-screen keyboard page
+ // won't open new windows/pages. See crbug.com/395621.
+ base::DictionaryValue* val = NULL;
+ if (args->GetDictionary(0, &val)) {
+ std::string screen_type;
+ if (!UserManager::Get()->IsUserLoggedIn()) {
+ screen_type = "login";
+ } else if (chromeos::ScreenLocker::default_screen_locker() &&
+ chromeos::ScreenLocker::default_screen_locker()->locked()) {
+ screen_type = "lock";
+ }
Nikita (slow) 2014/07/25 09:23:24 You should add another type here "multi-profiles l
Shu Chen 2014/07/25 09:41:06 Thanks, I will create another cl to support it.
+ if (!screen_type.empty())
+ val->SetStringWithoutPathExpansion("screen", screen_type);
+ }
+
DispatchEventToExtension(profile_, extension_id_,
input_ime::OnFocus::kEventName, args.Pass());
}
« 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