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

Unified Diff: extensions/browser/api/app_window/app_window_api.cc

Issue 1516253002: Whitelist IME extenions for app.window with type:panel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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: extensions/browser/api/app_window/app_window_api.cc
diff --git a/extensions/browser/api/app_window/app_window_api.cc b/extensions/browser/api/app_window/app_window_api.cc
index 87943aa5a6c95e4aa5e3446ca12454f9aeb830eb..1afcb25936c8cbcfef2ce8f0df11c6c62252bde2 100644
--- a/extensions/browser/api/app_window/app_window_api.cc
+++ b/extensions/browser/api/app_window/app_window_api.cc
@@ -66,9 +66,9 @@ const char kImeOptionIsNotSupported[] =
const char kImeWindowUnsupportedPlatform[] =
"The \"ime\" option can only be used on ChromeOS.";
#else
-const char kImeOptionMustBeTrueAndNeedsFrameNone[] =
- "IME extensions must create window with \"ime: true\" and "
- "\"frame: 'none'\".";
+const char kImeWindowMustBeImeWindowOrPanel[] =
+ "IME extensions must create ime window ( with \"ime: true\" and "
+ "\"frame: 'none'\") or panel window (with \"type: panel\").";
#endif
} // namespace app_window_constants
@@ -235,13 +235,17 @@ bool AppWindowCreateFunction::RunAsync() {
error_ = app_window_constants::kImeWindowUnsupportedPlatform;
return false;
#else
- // IME extensions must create window with "ime: true" and "frame: none".
- if (!options->ime.get() || !*options->ime.get() ||
- create_params.frame != AppWindow::FRAME_NONE) {
- error_ = app_window_constants::kImeOptionMustBeTrueAndNeedsFrameNone;
+ // IME extensions must create ime window (with "ime: true" and
+ // "frame: none") or panel window (with "type: panel").
+ if (options->ime.get() && *options->ime.get() &&
+ create_params.frame == AppWindow::FRAME_NONE) {
+ create_params.is_ime_window = true;
+ } else if (options->type == app_window::WINDOW_TYPE_PANEL) {
+ create_params.window_type = AppWindow::WINDOW_TYPE_PANEL;
+ } else {
+ error_ = app_window_constants::kImeWindowMustBeImeWindowOrPanel;
return false;
}
- create_params.is_ime_window = true;
#endif // OS_CHROMEOS
} else {
if (options->ime.get()) {

Powered by Google App Engine
This is Rietveld 408576698