Chromium Code Reviews| Index: chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc |
| diff --git a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc |
| index d3d80af4098e70cf967eb808caea1a26930810fd..56ed482f13ac801ea8121930bfc9e138dbd363a6 100644 |
| --- a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc |
| +++ b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc |
| @@ -4,20 +4,28 @@ |
| #include "chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.h" |
| +#include "ash/shelf/shelf.h" |
| #include "ash/shelf/shelf_delegate.h" |
| #include "ash/shelf/shelf_util.h" |
| #include "ash/shell.h" |
| +#include "ash/system/status_area_widget.h" |
| +#include "ash/wm/window_state_aura.h" |
| #include "ash/wm/window_util.h" |
| #include "base/strings/stringprintf.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| #include "chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.h" |
| #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
| +#include "chrome/common/extensions/extension_constants.h" |
| #include "extensions/browser/app_window/app_window.h" |
| #include "extensions/browser/app_window/native_app_window.h" |
| #include "extensions/common/extension.h" |
| #include "ui/aura/window_event_dispatcher.h" |
| +#if defined(OS_CHROMEOS) |
| +#include "ash/system/chromeos/ime_menu/ime_menu_tray.h" |
| +#endif // defined(OS_CHROMEOS) |
| + |
| using extensions::AppWindow; |
| using extensions::AppWindowRegistry; |
| @@ -109,6 +117,25 @@ void ExtensionAppWindowLauncherController::RegisterApp(AppWindow* app_window) { |
| return; |
| aura::Window* window = app_window->GetNativeWindow(); |
| + |
| +#if defined(OS_CHROMEOS) |
| + // IME window created by IME extension should also not register itself in the |
| + // lanucher. Instead, is should show ImeMenuTray in the status tray. |
| + if (extension_misc::IsImeMenuExtensionId(app_window->extension_id())) { |
| + ash::Shelf* shelf = ash::Shelf::ForWindow(app_window->GetNativeWindow()); |
| + if (shelf) { |
| + ash::ImeMenuTray* ime_menu_tray = |
| + shelf->shelf_widget()->status_area_widget()->ime_menu_tray(); |
| + if (ime_menu_tray) { |
| + ime_menu_tray->SetWindowState(ash::wm::GetWindowState(window)); |
| + // Sets the shelf id as -1 for the window to indicate that the icon |
| + // should be shown on the status area tray. |
| + ash::SetShelfIDForWindow(-1, window); |
|
sadrul
2016/06/20 16:18:12
I don't think setting special values for the Shelf
Azure Wei
2016/06/22 01:47:10
I added a property kShowIconOnTrayKey for window t
Azure Wei
2016/06/27 05:10:31
The window has not been shown was caused by wrong
|
| + } |
| + } |
| + return; |
| + } |
| +#endif // defined(OS_CHROMEOS) |
| // Get the app's shelf identifier and add an entry to the map. |
| DCHECK(window_to_app_shelf_id_map_.find(window) == |
| window_to_app_shelf_id_map_.end()); |