Commit 97874ef0 authored by bshe's avatar bshe Committed by Commit bot

Do not register IME app window in launcher

BUG=461865
TEST:
1. enable physical keyboard autocorrect feature from IME settings from chrome-extension://jkghodnilhceideoidjikpgommlajknk/hmm_options.html?code=xkb:us::eng
2. type "waht" and wait for a grey triangle appear underneath "waht"
At this point, an IME window is created.
3. verify no default app icon appear in launcher for the IME window

Review URL: https://codereview.chromium.org/955983004

Cr-Commit-Position: refs/heads/master@{#318734}
parent 4ba540fe
......@@ -145,6 +145,11 @@ void AppWindowLauncherController::OnWindowActivated(aura::Window* new_active,
}
void AppWindowLauncherController::RegisterApp(AppWindow* app_window) {
// Windows created by IME extension should be treated the same way as the
// virtual keyboard window, which does not register itself in launcher.
if (app_window->is_ime_window())
return;
aura::Window* window = app_window->GetNativeWindow();
// Get the app's shelf identifier and add an entry to the map.
DCHECK(window_to_app_shelf_id_map_.find(window) ==
......
......@@ -238,6 +238,7 @@ AppWindow::AppWindow(BrowserContext* context,
is_hidden_(false),
cached_always_on_top_(false),
requested_alpha_enabled_(false),
is_ime_window_(false),
image_loader_ptr_factory_(this) {
ExtensionsBrowserClient* client = ExtensionsBrowserClient::Get();
CHECK(!client->IsGuestSession(context) || context->IsOffTheRecord())
......@@ -273,6 +274,8 @@ void AppWindow::Init(const GURL& url,
requested_alpha_enabled_ = new_params.alpha_enabled;
is_ime_window_ = params.is_ime_window;
AppWindowClient* app_window_client = AppWindowClient::Get();
native_app_window_.reset(
app_window_client->CreateNativeAppWindow(this, &new_params));
......
......@@ -351,6 +351,12 @@ class AppWindow : public content::WebContentsDelegate,
// Whether the app window wants to be alpha enabled.
bool requested_alpha_enabled() const { return requested_alpha_enabled_; }
// Whether the app window is created by IME extensions.
// TODO(bshe): rename to hide_app_window_in_launcher if it is not used
// anywhere other than app_window_launcher_controller after M45. Otherwise,
// remove this TODO.
bool is_ime_window() const { return is_ime_window_; }
void SetAppWindowContentsForTesting(scoped_ptr<AppWindowContents> contents) {
app_window_contents_ = contents.Pass();
}
......@@ -559,6 +565,9 @@ class AppWindow : public content::WebContentsDelegate,
// Whether |alpha_enabled| was set in the CreateParams.
bool requested_alpha_enabled_;
// Whether |is_ime_window| was set in the CreateParams.
bool is_ime_window_;
base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(AppWindow);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment