summaryrefslogtreecommitdiff
path: root/ash
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2014-04-24 10:50:13 +0100
committerBen Murdoch <benm@google.com>2014-04-24 10:50:13 +0100
commit0529e5d033099cbfc42635f6f6183833b09dff6e (patch)
treebadea60062e611382d8a37e3b0bfda8d69760c2b /ash
parent8346740f6fb555ccbb9b4148ab63402ae8f6e4ca (diff)
downloadchromium_org-0529e5d033099cbfc42635f6f6183833b09dff6e.tar.gz
Merge from Chromium at DEPS revision 265802
This commit was generated by merge_to_master.py. Change-Id: I6fac2dbbce472b18ca943b6e6f247835b0bd6281
Diffstat (limited to 'ash')
-rw-r--r--ash/accelerators/accelerator_table.cc3
-rw-r--r--ash/ash.gyp13
-rw-r--r--ash/desktop_background/desktop_background_controller.cc12
-rw-r--r--ash/desktop_background/desktop_background_controller.h18
-rw-r--r--ash/desktop_background/wallpaper_resizer.cc4
-rw-r--r--ash/desktop_background/wallpaper_resizer.h2
-rw-r--r--ash/display/display_change_observer_chromeos.cc2
-rw-r--r--ash/display/display_controller_unittest.cc12
-rw-r--r--ash/display/display_manager.cc2
-rw-r--r--ash/display/mouse_cursor_event_filter.cc6
-rw-r--r--ash/display/mouse_cursor_event_filter_unittest.cc6
-rw-r--r--ash/display/screen_ash.cc3
-rw-r--r--ash/first_run/first_run_helper_unittest.cc4
-rw-r--r--ash/host/ash_window_tree_host_win.cc2
-rw-r--r--ash/ime/candidate_window_view.cc1
-rw-r--r--ash/resources/ash_resources.grd67
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_appmenu.pngbin346 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_appmenu_hover.pngbin327 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_appmenu_pressed.pngbin314 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_background.pngbin125 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_background_left.pngbin118 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_background_right.pngbin119 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_dimming_left.pngbin99 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_dimming_right.pngbin96 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_underline_bottom_active.pngbin105 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_underline_bottom_hover.pngbin105 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_underline_bottom_running.pngbin117 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_underline_left_active.pngbin241 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_underline_left_hover.pngbin241 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_underline_left_running.pngbin228 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_underline_right_active.pngbin246 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_underline_right_hover.pngbin246 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/launcher/launcher_underline_right_running.pngbin229 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/settings_app_icon.pngbin0 -> 1243 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/shelf_background.png (renamed from ash/resources/default_100_percent/common/alt_launcher/launcher_background.png)bin118 -> 118 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/shelf_corner.png (renamed from ash/resources/default_100_percent/common/launcher/launcher_corner.png)bin244 -> 244 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/shelf_dimming.png (renamed from ash/resources/default_100_percent/common/launcher/launcher_dimming.png)bin99 -> 99 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/shelf_overflow.png (renamed from ash/resources/default_100_percent/common/launcher/launcher_overflow.png)bin177 -> 177 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/shelf_underline_active.png (renamed from ash/resources/default_100_percent/common/alt_launcher/launcher_underline_active.png)bin75 -> 75 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/shelf_underline_running.png (renamed from ash/resources/default_100_percent/common/alt_launcher/launcher_underline_running.png)bin78 -> 78 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_app_menu_icon.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_app_menu_icon.png)bin224 -> 224 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_icon_background_normal.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_icon_background_normal.png)bin128 -> 128 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_icon_background_onblack_normal.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_icon_background_onblack_normal.png)bin179 -> 179 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_icon_background_pressed.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_icon_background_pressed.png)bin376 -> 376 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_notification_icon.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_notification_icon.png)bin231 -> 231 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_normal_center.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_center.png)bin87 -> 87 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_normal_left.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_left.png)bin97 -> 97 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_normal_onblack_center.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_onblack_center.png)bin106 -> 106 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_normal_onblack_left.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_onblack_left.png)bin127 -> 127 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_normal_onblack_right.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_onblack_right.png)bin124 -> 124 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_normal_right.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_right.png)bin104 -> 104 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_pressed_center.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_pressed_center.png)bin146 -> 146 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_pressed_left.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_pressed_left.png)bin226 -> 226 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_pressed_right.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_pressed_right.png)bin235 -> 235 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_bottom.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_bottom.png)bin103 -> 103 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_center.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_center.png)bin86 -> 86 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_onblack_bottom.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_onblack_bottom.png)bin103 -> 103 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_onblack_center.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_onblack_center.png)bin93 -> 93 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_onblack_top.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_onblack_top.png)bin102 -> 102 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_top.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_top.png)bin94 -> 94 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_vertical_pressed_bottom.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_pressed_bottom.png)bin162 -> 162 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_vertical_pressed_center.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_pressed_center.png)bin105 -> 105 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/status_tray_vertical_pressed_top.png (renamed from ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_pressed_top.png)bin132 -> 132 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/task_manager.png (renamed from ash/resources/default_100_percent/common/launcher/task_manager.png)bin530 -> 530 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/window_switcher_icon_incognito.png (renamed from ash/resources/default_100_percent/common/launcher/window_switcher_icon_incognito.png)bin133 -> 133 bytes
-rw-r--r--ash/resources/default_100_percent/common/shelf/window_switcher_icon_normal.png (renamed from ash/resources/default_100_percent/common/launcher/window_switcher_icon_normal.png)bin117 -> 117 bytes
-rw-r--r--ash/resources/default_100_percent/common/window_control_icon_close.pngbin142 -> 137 bytes
-rw-r--r--ash/resources/default_100_percent/common/window_control_icon_close_inactive.pngbin191 -> 188 bytes
-rw-r--r--ash/resources/default_100_percent/common/window_control_icon_left_snapped.pngbin159 -> 125 bytes
-rw-r--r--ash/resources/default_100_percent/common/window_control_icon_minimize_inactive.pngbin100 -> 92 bytes
-rw-r--r--ash/resources/default_100_percent/common/window_control_icon_right_snapped.pngbin156 -> 120 bytes
-rw-r--r--ash/resources/default_100_percent/common/window_control_icon_size_inactive.pngbin107 -> 107 bytes
-rw-r--r--ash/resources/default_100_percent/cros/status/status_managed.pngbin413 -> 160 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_appmenu.pngbin662 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_appmenu_hover.pngbin574 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_appmenu_pressed.pngbin545 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_background.pngbin152 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_background_left.pngbin146 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_background_right.pngbin145 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_dimming_left.pngbin109 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_dimming_right.pngbin111 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_underline_bottom_active.pngbin141 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_underline_bottom_hover.pngbin141 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_underline_bottom_running.pngbin168 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_underline_left_active.pngbin413 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_underline_left_hover.pngbin413 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_underline_left_running.pngbin340 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_underline_right_active.pngbin410 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_underline_right_hover.pngbin410 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/launcher/launcher_underline_right_running.pngbin345 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/settings_app_icon.pngbin0 -> 3708 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/shelf_background.png (renamed from ash/resources/default_200_percent/common/alt_launcher/launcher_background.png)bin148 -> 148 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/shelf_corner.png (renamed from ash/resources/default_200_percent/common/launcher/launcher_corner.png)bin210 -> 210 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/shelf_dimming.png (renamed from ash/resources/default_200_percent/common/launcher/launcher_dimming.png)bin106 -> 106 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/shelf_overflow.png (renamed from ash/resources/default_200_percent/common/launcher/launcher_overflow.png)bin314 -> 314 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/shelf_underline_active.png (renamed from ash/resources/default_200_percent/common/alt_launcher/launcher_underline_active.png)bin98 -> 98 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/shelf_underline_running.png (renamed from ash/resources/default_200_percent/common/alt_launcher/launcher_underline_running.png)bin97 -> 97 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_app_menu_icon.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_app_menu_icon.png)bin307 -> 307 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_icon_background_normal.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_icon_background_normal.png)bin189 -> 189 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_icon_background_onblack_normal.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_icon_background_onblack_normal.png)bin279 -> 279 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_icon_background_pressed.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_icon_background_pressed.png)bin769 -> 769 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_notification_icon.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_notification_icon.png)bin324 -> 324 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_normal_center.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_center.png)bin90 -> 90 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_normal_left.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_left.png)bin123 -> 123 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_normal_onblack_center.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_onblack_center.png)bin121 -> 121 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_normal_onblack_left.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_onblack_left.png)bin175 -> 175 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_normal_onblack_right.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_onblack_right.png)bin165 -> 165 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_normal_right.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_right.png)bin124 -> 124 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_pressed_center.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_pressed_center.png)bin177 -> 177 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_pressed_left.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_pressed_left.png)bin408 -> 408 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_pressed_right.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_pressed_right.png)bin431 -> 431 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_bottom.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_bottom.png)bin127 -> 127 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_center.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_center.png)bin91 -> 91 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_onblack_bottom.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_onblack_bottom.png)bin125 -> 125 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_onblack_center.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_onblack_center.png)bin96 -> 96 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_onblack_top.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_onblack_top.png)bin147 -> 147 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_top.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_top.png)bin123 -> 123 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_vertical_pressed_bottom.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_pressed_bottom.png)bin345 -> 345 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_vertical_pressed_center.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_pressed_center.png)bin129 -> 129 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/status_tray_vertical_pressed_top.png (renamed from ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_pressed_top.png)bin264 -> 264 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/task_manager.png (renamed from ash/resources/default_200_percent/common/launcher/task_manager.png)bin1288 -> 1288 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/window_switcher_icon_incognito.png (renamed from ash/resources/default_200_percent/common/launcher/window_switcher_icon_incognito.png)bin245 -> 245 bytes
-rw-r--r--ash/resources/default_200_percent/common/shelf/window_switcher_icon_normal.png (renamed from ash/resources/default_200_percent/common/launcher/window_switcher_icon_normal.png)bin157 -> 157 bytes
-rw-r--r--ash/resources/default_200_percent/cros/status/status_managed.pngbin775 -> 232 bytes
-rw-r--r--ash/root_window_controller.cc27
-rw-r--r--ash/root_window_controller_unittest.cc27
-rw-r--r--ash/shelf/shelf_layout_manager.cc4
-rw-r--r--ash/shell.cc10
-rw-r--r--ash/shell.h7
-rw-r--r--ash/shell_observer.h3
-rw-r--r--ash/shell_window_ids.h31
-rw-r--r--ash/strings/ash_strings_fi.xtb8
-rw-r--r--ash/system/chromeos/enterprise/tray_enterprise.cc2
-rw-r--r--ash/system/chromeos/power/power_event_observer.cc2
-rw-r--r--ash/system/chromeos/power/power_event_observer.h2
-rw-r--r--ash/system/chromeos/power/power_event_observer_unittest.cc4
-rw-r--r--ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc2
-rw-r--r--ash/system/tray/default_system_tray_delegate.cc4
-rw-r--r--ash/system/tray/default_system_tray_delegate.h1
-rw-r--r--ash/system/tray/system_tray_delegate.h1
-rw-r--r--ash/system/tray/system_tray_item.cc3
-rw-r--r--ash/test/ash_test_helper.cc4
-rw-r--r--ash/test/cursor_manager_test_api.cc11
-rw-r--r--ash/test/cursor_manager_test_api.h8
-rw-r--r--ash/wm/OWNERS1
-rw-r--r--ash/wm/app_list_controller.cc2
-rw-r--r--ash/wm/ash_native_cursor_manager.cc3
-rw-r--r--ash/wm/ash_native_cursor_manager_interactive_uitest.cc4
-rw-r--r--ash/wm/ash_native_cursor_manager_unittest.cc73
-rw-r--r--ash/wm/default_state.cc5
-rw-r--r--ash/wm/drag_window_resizer_unittest.cc12
-rw-r--r--ash/wm/image_cursors.cc54
-rw-r--r--ash/wm/image_cursors.h15
-rw-r--r--ash/wm/maximize_mode/maximize_mode_controller.cc20
-rw-r--r--ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc25
-rw-r--r--ash/wm/maximize_mode/workspace_backdrop_delegate.cc7
-rw-r--r--ash/wm/overview/OWNERS1
-rw-r--r--ash/wm/overview/window_overview.cc2
-rw-r--r--ash/wm/overview/window_selector_controller.cc11
-rw-r--r--ash/wm/overview/window_selector_item.cc118
-rw-r--r--ash/wm/overview/window_selector_item.h19
-rw-r--r--ash/wm/overview/window_selector_unittest.cc57
-rw-r--r--ash/wm/overview/window_selector_window.cc20
-rw-r--r--ash/wm/overview/window_selector_window.h4
-rw-r--r--ash/wm/panels/OWNERS1
-rw-r--r--ash/wm/panels/attached_panel_window_targeter.cc75
-rw-r--r--ash/wm/panels/attached_panel_window_targeter.h43
-rw-r--r--ash/wm/panels/panel_layout_manager_unittest.cc77
-rw-r--r--ash/wm/system_modal_container_layout_manager_unittest.cc33
-rw-r--r--ash/wm/toplevel_window_event_handler.cc12
-rw-r--r--ash/wm/window_positioner.cc26
-rw-r--r--ash/wm/window_positioner_unittest.cc42
-rw-r--r--ash/wm/workspace/workspace_event_handler.cc92
-rw-r--r--ash/wm/workspace/workspace_event_handler.h7
-rw-r--r--ash/wm/workspace/workspace_event_handler_unittest.cc182
-rw-r--r--ash/wm/workspace_controller_unittest.cc34
176 files changed, 1043 insertions, 352 deletions
diff --git a/ash/accelerators/accelerator_table.cc b/ash/accelerators/accelerator_table.cc
index dc20fe1c6b..10b568c45d 100644
--- a/ash/accelerators/accelerator_table.cc
+++ b/ash/accelerators/accelerator_table.cc
@@ -375,9 +375,6 @@ const size_t kNonrepeatableActionsLength =
const AcceleratorAction kActionsAllowedInAppMode[] = {
BRIGHTNESS_DOWN,
BRIGHTNESS_UP,
- CYCLE_BACKWARD_MRU,
- CYCLE_FORWARD_MRU,
- TOGGLE_OVERVIEW,
DISABLE_CAPS_LOCK,
KEYBOARD_BRIGHTNESS_DOWN,
KEYBOARD_BRIGHTNESS_UP,
diff --git a/ash/ash.gyp b/ash/ash.gyp
index a0db4b0439..b0b9c6efc7 100644
--- a/ash/ash.gyp
+++ b/ash/ash.gyp
@@ -41,7 +41,7 @@
'../ui/views/controls/webview/webview.gyp:webview',
'../ui/views/views.gyp:views',
'../ui/web_dialogs/web_dialogs.gyp:web_dialogs',
- '../ui/wm/wm.gyp:wm_core',
+ '../ui/wm/wm.gyp:wm',
'../url/url.gyp:url_lib',
'ash_strings.gyp:ash_strings',
'ash_resources',
@@ -371,8 +371,8 @@
'system/chromeos/power/tray_power.h',
'system/chromeos/power/video_activity_notifier.cc',
'system/chromeos/power/video_activity_notifier.h',
- 'system/chromeos/rotation/tray_rotation_lock.h',
'system/chromeos/rotation/tray_rotation_lock.cc',
+ 'system/chromeos/rotation/tray_rotation_lock.h',
'system/chromeos/screen_security/screen_capture_observer.h',
'system/chromeos/screen_security/screen_capture_tray_item.cc',
'system/chromeos/screen_security/screen_capture_tray_item.h',
@@ -606,6 +606,8 @@
'wm/overview/window_selector_panels.h',
'wm/overview/window_selector_window.cc',
'wm/overview/window_selector_window.h',
+ 'wm/panels/attached_panel_window_targeter.cc',
+ 'wm/panels/attached_panel_window_targeter.h',
'wm/panels/panel_frame_view.cc',
'wm/panels/panel_frame_view.h',
'wm/panels/panel_layout_manager.cc',
@@ -718,6 +720,7 @@
'../device/bluetooth/bluetooth.gyp:device_bluetooth',
'../ui/chromeos/ui_chromeos.gyp:ui_chromeos',
'../ui/display/display.gyp:display',
+ '../ui/display/display.gyp:display_util',
],
}, { # else: chromeos!=1
'sources/': [
@@ -729,7 +732,6 @@
}],
],
},
-
{
'target_name': 'ash_with_content',
'type': '<(component)',
@@ -870,6 +872,7 @@
'../ui/aura/aura.gyp:aura',
'../ui/aura/aura.gyp:aura_test_support',
'../ui/base/ui_base.gyp:ui_base',
+ '../ui/base/ui_base.gyp:ui_base_test_support',
'../ui/compositor/compositor.gyp:compositor',
'../ui/compositor/compositor.gyp:compositor_test_support',
'../ui/events/events.gyp:events',
@@ -880,13 +883,12 @@
'../ui/message_center/message_center.gyp:message_center',
'../ui/message_center/message_center.gyp:message_center_test_support',
'../ui/resources/ui_resources.gyp:ui_resources',
- '../ui/ui_unittests.gyp:ui_test_support',
'../ui/views/controls/webview/webview_tests.gyp:webview_test_support',
'../ui/views/examples/examples.gyp:views_examples_with_content_lib',
'../ui/views/views.gyp:views',
'../ui/views/views.gyp:views_test_support',
'../ui/web_dialogs/web_dialogs.gyp:web_dialogs_test_support',
- '../ui/wm/wm.gyp:wm_core',
+ '../ui/wm/wm.gyp:wm',
'../url/url.gyp:url_lib',
'ash_strings.gyp:ash_strings',
'ash',
@@ -1070,6 +1072,7 @@
}],
['chromeos==1', {
'dependencies': [
+ '../chromeos/chromeos.gyp:chromeos_test_support_without_gmock',
'../chromeos/chromeos.gyp:power_manager_proto',
'../device/bluetooth/bluetooth.gyp:device_bluetooth',
'../ui/display/display.gyp:display',
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc
index 8b54cb5b29..e756997797 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -43,6 +43,8 @@ const int kWallpaperReloadDelayMs = 2000;
} // namespace
+const int DesktopBackgroundController::kInvalidResourceID = -1;
+
DesktopBackgroundController::DesktopBackgroundController()
: locked_(false),
desktop_background_mode_(BACKGROUND_NONE),
@@ -83,7 +85,8 @@ bool DesktopBackgroundController::SetWallpaperImage(const gfx::ImageSkia& image,
VLOG(1) << "SetWallpaper: image_id=" << WallpaperResizer::GetImageId(image)
<< " layout=" << layout;
- if (WallpaperIsAlreadyLoaded(&image, kInvalidResourceID, layout)) {
+ if (WallpaperIsAlreadyLoaded(
+ &image, kInvalidResourceID, true /* compare_layouts */, layout)) {
VLOG(1) << "Wallpaper is already loaded";
return false;
}
@@ -104,7 +107,8 @@ bool DesktopBackgroundController::SetWallpaperResource(int resource_id,
VLOG(1) << "SetWallpaper: resource_id=" << resource_id
<< " layout=" << layout;
- if (WallpaperIsAlreadyLoaded(NULL, resource_id, layout)) {
+ if (WallpaperIsAlreadyLoaded(
+ NULL, resource_id, true /* compare_layouts */, layout)) {
VLOG(1) << "Wallpaper is already loaded";
return false;
}
@@ -196,11 +200,13 @@ gfx::Size DesktopBackgroundController::GetMaxDisplaySizeInNative() {
bool DesktopBackgroundController::WallpaperIsAlreadyLoaded(
const gfx::ImageSkia* image,
int resource_id,
+ bool compare_layouts,
WallpaperLayout layout) const {
if (!current_wallpaper_.get())
return false;
- if (layout != current_wallpaper_->layout())
+ // Compare layouts only if necessary.
+ if (compare_layouts && layout != current_wallpaper_->layout())
return false;
if (image) {
diff --git a/ash/desktop_background/desktop_background_controller.h b/ash/desktop_background/desktop_background_controller.h
index b1099c619f..8d9f698b8f 100644
--- a/ash/desktop_background/desktop_background_controller.h
+++ b/ash/desktop_background/desktop_background_controller.h
@@ -37,7 +37,7 @@ enum WallpaperLayout {
// desktop's size.
WALLPAPER_LAYOUT_STRETCH,
// Tile the wallpaper over the background without scaling it.
- WALLPAPER_LAYOUT_TILE,
+ WALLPAPER_LAYOUT_TILE
};
const SkColor kLoginWallpaperColor = 0xFEFEFE;
@@ -57,6 +57,10 @@ class ASH_EXPORT DesktopBackgroundController
BACKGROUND_IMAGE,
};
+ // This is used to initialize Resource ID variables and to denote "no
+ // resource ID" in parameters.
+ static const int kInvalidResourceID;
+
DesktopBackgroundController();
virtual ~DesktopBackgroundController();
@@ -110,18 +114,20 @@ class ASH_EXPORT DesktopBackgroundController
// maximum width of all displays, and the maximum height of all displays.
static gfx::Size GetMaxDisplaySizeInNative();
- private:
- friend class DesktopBackgroundControllerTest;
- // friend class chromeos::WallpaperManagerBrowserTestDefaultWallpaper;
- FRIEND_TEST_ALL_PREFIXES(DesktopBackgroundControllerTest, GetMaxDisplaySize);
-
// Returns true if the specified wallpaper is already stored
// in |current_wallpaper_|.
// If |image| is NULL, resource_id is compared.
+ // If |compare_layouts| is false, layout is ignored.
bool WallpaperIsAlreadyLoaded(const gfx::ImageSkia* image,
int resource_id,
+ bool compare_layouts,
WallpaperLayout layout) const;
+ private:
+ friend class DesktopBackgroundControllerTest;
+ // friend class chromeos::WallpaperManagerBrowserTestDefaultWallpaper;
+ FRIEND_TEST_ALL_PREFIXES(DesktopBackgroundControllerTest, GetMaxDisplaySize);
+
// Creates view for all root windows, or notifies them to repaint if they
// already exist.
void SetDesktopBackgroundImageMode();
diff --git a/ash/desktop_background/wallpaper_resizer.cc b/ash/desktop_background/wallpaper_resizer.cc
index 46497b2c1c..4bd0264c58 100644
--- a/ash/desktop_background/wallpaper_resizer.cc
+++ b/ash/desktop_background/wallpaper_resizer.cc
@@ -93,8 +93,6 @@ void Resize(SkBitmap orig_bitmap,
} // namespace
-const int kInvalidResourceID = -1;
-
// static
uint32_t WallpaperResizer::GetImageId(const gfx::ImageSkia& image) {
const gfx::ImageSkiaRep& image_rep = image.GetRepresentation(1.0f);
@@ -120,7 +118,7 @@ WallpaperResizer::WallpaperResizer(const gfx::ImageSkia& image,
WallpaperLayout layout)
: image_(image),
original_image_id_(GetImageId(image_)),
- resource_id_(kInvalidResourceID),
+ resource_id_(DesktopBackgroundController::kInvalidResourceID),
target_size_(target_size),
layout_(layout),
weak_ptr_factory_(this) {
diff --git a/ash/desktop_background/wallpaper_resizer.h b/ash/desktop_background/wallpaper_resizer.h
index 2b86799492..989dbdb694 100644
--- a/ash/desktop_background/wallpaper_resizer.h
+++ b/ash/desktop_background/wallpaper_resizer.h
@@ -18,8 +18,6 @@ namespace ash {
class WallpaperResizerObserver;
-extern const int kInvalidResourceID;
-
// Stores the current wallpaper data and resize it to |target_size| if needed.
class ASH_EXPORT WallpaperResizer {
public:
diff --git a/ash/display/display_change_observer_chromeos.cc b/ash/display/display_change_observer_chromeos.cc
index 4dfc8c4fb4..ad6b029121 100644
--- a/ash/display/display_change_observer_chromeos.cc
+++ b/ash/display/display_change_observer_chromeos.cc
@@ -19,9 +19,9 @@
#include "grit/ash_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/compositor/dip_util.h"
-#include "ui/display/display_util.h"
#include "ui/display/types/chromeos/display_mode.h"
#include "ui/display/types/chromeos/display_snapshot.h"
+#include "ui/display/util/display_util.h"
#include "ui/gfx/display.h"
namespace ash {
diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc
index 3da1368f2d..95b7af6a42 100644
--- a/ash/display/display_controller_unittest.cc
+++ b/ash/display/display_controller_unittest.cc
@@ -935,11 +935,11 @@ TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) {
EXPECT_EQ(1.0f, primary_root->GetHost()->compositor()->
device_scale_factor());
primary_root->MoveCursorTo(gfx::Point(50, 50));
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
EXPECT_EQ(2.0f, secondary_root->GetHost()->compositor()->
device_scale_factor());
secondary_root->MoveCursorTo(gfx::Point(50, 50));
- EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
// Switch primary and secondary
display_controller->SetPrimaryDisplay(secondary_display);
@@ -949,23 +949,23 @@ TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) {
EXPECT_EQ(1.0f, secondary_root->GetHost()->compositor()->
device_scale_factor());
secondary_root->MoveCursorTo(gfx::Point(50, 50));
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
primary_root->MoveCursorTo(gfx::Point(50, 50));
EXPECT_EQ(2.0f, primary_root->GetHost()->compositor()->
device_scale_factor());
- EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
// Deleting 2nd display.
UpdateDisplay("200x200");
RunAllPendingInMessageLoop(); // RootWindow is deleted in a posted task.
// Cursor's device scale factor should be updated even without moving cursor.
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
primary_root->MoveCursorTo(gfx::Point(50, 50));
EXPECT_EQ(1.0f, primary_root->GetHost()->compositor()->
device_scale_factor());
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
}
TEST_F(DisplayControllerTest, OverscanInsets) {
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc
index 83d747ae10..7f6d71347a 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -838,6 +838,8 @@ bool DisplayManager::IsMirrored() const {
}
const DisplayInfo& DisplayManager::GetDisplayInfo(int64 display_id) const {
+ DCHECK_NE(gfx::Display::kInvalidDisplayID, display_id);
+
std::map<int64, DisplayInfo>::const_iterator iter =
display_info_.find(display_id);
CHECK(iter != display_info_.end()) << display_id;
diff --git a/ash/display/mouse_cursor_event_filter.cc b/ash/display/mouse_cursor_event_filter.cc
index cbc2207bc3..8807f9900a 100644
--- a/ash/display/mouse_cursor_event_filter.cc
+++ b/ash/display/mouse_cursor_event_filter.cc
@@ -98,10 +98,8 @@ void MouseCursorEventFilter::OnMouseEvent(ui::MouseEvent* event) {
return;
}
- if (!(event->flags() & ui::EF_IS_SYNTHESIZED)) {
- Shell::GetInstance()->display_controller()->
- cursor_window_controller()->UpdateLocation();
- }
+ Shell::GetInstance()->display_controller()->
+ cursor_window_controller()->UpdateLocation();
gfx::Point point_in_screen(event->location());
wm::ConvertPointToScreen(target, &point_in_screen);
diff --git a/ash/display/mouse_cursor_event_filter_unittest.cc b/ash/display/mouse_cursor_event_filter_unittest.cc
index 1b34456320..3325d37a0c 100644
--- a/ash/display/mouse_cursor_event_filter_unittest.cc
+++ b/ash/display/mouse_cursor_event_filter_unittest.cc
@@ -368,11 +368,11 @@ TEST_F(MouseCursorEventFilterTest, CursorDeviceScaleFactor) {
test::CursorManagerTestApi cursor_test_api(
Shell::GetInstance()->cursor_manager());
- EXPECT_EQ(1.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
WarpMouseCursorIfNecessary(root_windows[0], gfx::Point(399, 200));
- EXPECT_EQ(2.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
WarpMouseCursorIfNecessary(root_windows[1], gfx::Point(400, 200));
- EXPECT_EQ(1.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
}
} // namespace ash
diff --git a/ash/display/screen_ash.cc b/ash/display/screen_ash.cc
index d32deb85c4..9d42e49e26 100644
--- a/ash/display/screen_ash.cc
+++ b/ash/display/screen_ash.cc
@@ -234,7 +234,8 @@ gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const {
return GetPrimaryDisplay();
const RootWindowSettings* rws = GetRootWindowSettings(root_window);
if (rws->shutdown)
- return gfx::Display(1);
+ return GetPrimaryDisplay();
+
int64 id = rws->display_id;
// if id is |kInvaildDisplayID|, it's being deleted.
DCHECK(id != gfx::Display::kInvalidDisplayID);
diff --git a/ash/first_run/first_run_helper_unittest.cc b/ash/first_run/first_run_helper_unittest.cc
index 6952dd6152..a86c064c7a 100644
--- a/ash/first_run/first_run_helper_unittest.cc
+++ b/ash/first_run/first_run_helper_unittest.cc
@@ -137,10 +137,12 @@ TEST_F(FirstRunHelperTest, ModalWindowDoesNotBlock) {
overlay_window->Focus();
EXPECT_TRUE(overlay_window->HasFocus());
int mouse_events;
- overlay_window->SetEventFilter(new CountingEventHandler(&mouse_events));
+ CountingEventHandler handler(&mouse_events);
+ overlay_window->AddPreTargetHandler(&handler);
GetEventGenerator().PressLeftButton();
GetEventGenerator().ReleaseLeftButton();
EXPECT_EQ(mouse_events, 2);
+ overlay_window->RemovePreTargetHandler(&handler);
}
} // namespace test
diff --git a/ash/host/ash_window_tree_host_win.cc b/ash/host/ash_window_tree_host_win.cc
index 5ea0f4a1ae..27fd5a47f9 100644
--- a/ash/host/ash_window_tree_host_win.cc
+++ b/ash/host/ash_window_tree_host_win.cc
@@ -108,7 +108,7 @@ class ASH_EXPORT AshWindowTreeHostWin : public AshWindowTreeHost,
} // namespace
AshWindowTreeHost* AshWindowTreeHost::Create(const gfx::Rect& initial_bounds) {
- if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
+ if (base::win::GetVersion() >= base::win::VERSION_WIN7 &&
!CommandLine::ForCurrentProcess()->HasSwitch(
ash::switches::kForceAshToDesktop))
return AshRemoteWindowTreeHostWin::GetInstance();
diff --git a/ash/ime/candidate_window_view.cc b/ash/ime/candidate_window_view.cc
index ca37b23899..87a39f5afd 100644
--- a/ash/ime/candidate_window_view.cc
+++ b/ash/ime/candidate_window_view.cc
@@ -148,6 +148,7 @@ CandidateWindowView::CandidateWindowView(gfx::NativeView parent)
should_show_at_composition_head_(false),
should_show_upper_side_(false),
was_candidate_window_open_(false) {
+ set_use_focusless(true);
set_parent_window(parent);
set_margins(gfx::Insets());
diff --git a/ash/resources/ash_resources.grd b/ash/resources/ash_resources.grd
index ac3b4fc4b1..12017454b6 100644
--- a/ash/resources/ash_resources.grd
+++ b/ash/resources/ash_resources.grd
@@ -17,23 +17,22 @@
<!-- KEEP THESE IN ALPHABETICAL ORDER! DO NOT ADD TO RANDOM PLACES JUST
BECAUSE YOUR RESOURCES ARE FUNCTIONALLY RELATED OR FALL UNDER THE
SAME CONDITIONALS. -->
- <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_BACKGROUND" file="common/launcher/launcher_background.png" />
- <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_CORNER" file="common/launcher/launcher_corner.png" />
- <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_DIMMING" file="common/launcher/launcher_dimming.png" />
- <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_ICON_APPLIST" file="common/alt_launcher/status_app_menu_icon.png" />
- <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_ICON_APPLIST_HOT" file="common/launcher/launcher_appmenu_hover.png" />
- <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_ICON_APPLIST_PUSHED" file="common/launcher/launcher_appmenu_pressed.png" />
- <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_LIST_BROWSER" file="common/launcher/window_switcher_icon_normal.png" />
- <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_LIST_INCOGNITO_BROWSER" file="common/launcher/window_switcher_icon_incognito.png" />
- <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_OVERFLOW" file="common/launcher/launcher_overflow.png" />
- <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_UNDERLINE_ACTIVE" file="common/alt_launcher/launcher_underline_active.png" />
- <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_UNDERLINE_RUNNING" file="common/alt_launcher/launcher_underline_running.png" />
- <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_ICON_TASK_MANAGER" file="common/launcher/task_manager.png" />
+ <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_BACKGROUND" file="common/shelf/shelf_background.png" />
+ <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_CORNER" file="common/shelf/shelf_corner.png" />
+ <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_DIMMING" file="common/shelf/shelf_dimming.png" />
+ <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_ICON_APPLIST" file="common/shelf/status_app_menu_icon.png" />
+ <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_LIST_BROWSER" file="common/shelf/window_switcher_icon_normal.png" />
+ <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_LIST_INCOGNITO_BROWSER" file="common/shelf/window_switcher_icon_incognito.png" />
+ <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_OVERFLOW" file="common/shelf/shelf_overflow.png" />
+ <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_UNDERLINE_ACTIVE" file="common/shelf/shelf_underline_active.png" />
+ <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_UNDERLINE_RUNNING" file="common/shelf/shelf_underline_running.png" />
+ <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_ICON_SETTINGS" file="common/shelf/settings_app_icon.png" />
+ <structure type="chrome_scaled_image" name="IDR_ASH_SHELF_ICON_TASK_MANAGER" file="common/shelf/task_manager.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_MULTI_WINDOW_RESIZE_H" file="common/multi_window_resize_horizontal.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_MULTI_WINDOW_RESIZE_V" file="common/multi_window_resize_vertical.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL" file="common/alt_launcher/status_icon_background_normal.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK" file="common/alt_launcher/status_icon_background_onblack_normal.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED" file="common/alt_launcher/status_icon_background_pressed.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL" file="common/shelf/status_icon_background_normal.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK" file="common/shelf/status_icon_background_onblack_normal.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED" file="common/shelf/status_icon_background_pressed.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_PHANTOM_WINDOW_BOTTOM" file="common/phantom_window_bottom.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_PHANTOM_WINDOW_BOTTOM_LEFT" file="common/phantom_window_bottom_left.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_PHANTOM_WINDOW_BOTTOM_RIGHT" file="common/phantom_window_bottom_right.png" />
@@ -51,24 +50,24 @@
<structure type="chrome_scaled_image" name="IDR_AURA_RESIZE_SHADOW_TOP" file="common/resize_shadow_top.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_RESIZE_SHADOW_TOP_LEFT" file="common/resize_shadow_top_left.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_RESIZE_SHADOW_TOP_RIGHT" file="common/resize_shadow_top_right.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_CENTER" file="common/alt_launcher/status_tray_normal_center.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_CENTER_ONBLACK" file="common/alt_launcher/status_tray_normal_onblack_center.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_CENTER_PRESSED" file="common/alt_launcher/status_tray_pressed_center.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_LEFT" file="common/alt_launcher/status_tray_normal_left.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_LEFT_ONBLACK" file="common/alt_launcher/status_tray_normal_onblack_left.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_LEFT_PRESSED" file="common/alt_launcher/status_tray_pressed_left.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_RIGHT" file="common/alt_launcher/status_tray_normal_right.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_RIGHT_ONBLACK" file="common/alt_launcher/status_tray_normal_onblack_right.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_RIGHT_PRESSED" file="common/alt_launcher/status_tray_pressed_right.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_BOTTOM" file="common/alt_launcher/status_tray_vertical_normal_bottom.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_BOTTOM_ONBLACK" file="common/alt_launcher/status_tray_vertical_normal_onblack_bottom.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_BOTTOM_PRESSED" file="common/alt_launcher/status_tray_vertical_pressed_bottom.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_TOP" file="common/alt_launcher/status_tray_vertical_normal_top.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_TOP_ONBLACK" file="common/alt_launcher/status_tray_vertical_normal_onblack_top.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_TOP_PRESSED" file="common/alt_launcher/status_tray_vertical_pressed_top.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_CENTER" file="common/alt_launcher/status_tray_vertical_normal_center.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_CENTER_ONBLACK" file="common/alt_launcher/status_tray_vertical_normal_onblack_center.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_CENTER_PRESSED" file="common/alt_launcher/status_tray_vertical_pressed_center.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_CENTER" file="common/shelf/status_tray_normal_center.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_CENTER_ONBLACK" file="common/shelf/status_tray_normal_onblack_center.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_CENTER_PRESSED" file="common/shelf/status_tray_pressed_center.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_LEFT" file="common/shelf/status_tray_normal_left.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_LEFT_ONBLACK" file="common/shelf/status_tray_normal_onblack_left.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_LEFT_PRESSED" file="common/shelf/status_tray_pressed_left.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_RIGHT" file="common/shelf/status_tray_normal_right.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_RIGHT_ONBLACK" file="common/shelf/status_tray_normal_onblack_right.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_HORIZ_RIGHT_PRESSED" file="common/shelf/status_tray_pressed_right.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_BOTTOM" file="common/shelf/status_tray_vertical_normal_bottom.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_BOTTOM_ONBLACK" file="common/shelf/status_tray_vertical_normal_onblack_bottom.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_BOTTOM_PRESSED" file="common/shelf/status_tray_vertical_pressed_bottom.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_TOP" file="common/shelf/status_tray_vertical_normal_top.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_TOP_ONBLACK" file="common/shelf/status_tray_vertical_normal_onblack_top.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_TOP_PRESSED" file="common/shelf/status_tray_vertical_pressed_top.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_CENTER" file="common/shelf/status_tray_vertical_normal_center.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_CENTER_ONBLACK" file="common/shelf/status_tray_vertical_normal_onblack_center.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_TRAY_BG_VERTICAL_CENTER_PRESSED" file="common/shelf/status_tray_vertical_pressed_center.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_TRAY_POPUP_LABEL_BUTTON_BORDER" file="common/tray_popup_label_button_border.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_TRAY_POPUP_LABEL_BUTTON_HOVER_BACKGROUND" file="common/tray_popup_label_button_hover_background.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_TRAY_POPUP_LABEL_BUTTON_NORMAL_BACKGROUND" file="common/tray_popup_label_button_normal_background.png" />
@@ -155,7 +154,7 @@
<if expr="chromeos">
<structure type="chrome_scaled_image" name="IDR_AURA_NOTIFICATION_LOW_POWER_CHARGER" file="cros/notification/notification_low_power_charger.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_NOTIFICATION_DISPLAY" file="cros/notification/display_notification_icon.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_ENTERPRISE_DARK" file="cros/status/status_managed.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_ENTERPRISE" file="cros/status/status_managed.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_MANAGED_USER" file="cros/status/status_managed_mode_user.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_1X" file="cros/network/statusbar_network_1x.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_3G_DARK" file="cros/network/statusbar_network_3g_dark.png" />
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_appmenu.png b/ash/resources/default_100_percent/common/launcher/launcher_appmenu.png
deleted file mode 100644
index 719d77212f..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_appmenu.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_appmenu_hover.png b/ash/resources/default_100_percent/common/launcher/launcher_appmenu_hover.png
deleted file mode 100644
index a41d0e48e7..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_appmenu_hover.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_appmenu_pressed.png b/ash/resources/default_100_percent/common/launcher/launcher_appmenu_pressed.png
deleted file mode 100644
index 98750f87fd..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_appmenu_pressed.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_background.png b/ash/resources/default_100_percent/common/launcher/launcher_background.png
deleted file mode 100644
index 212c0de394..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_background.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_background_left.png b/ash/resources/default_100_percent/common/launcher/launcher_background_left.png
deleted file mode 100644
index aabd3b90d2..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_background_left.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_background_right.png b/ash/resources/default_100_percent/common/launcher/launcher_background_right.png
deleted file mode 100644
index dea5d31bd3..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_background_right.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_dimming_left.png b/ash/resources/default_100_percent/common/launcher/launcher_dimming_left.png
deleted file mode 100644
index 42a41068b6..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_dimming_left.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_dimming_right.png b/ash/resources/default_100_percent/common/launcher/launcher_dimming_right.png
deleted file mode 100644
index f8852ac72c..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_dimming_right.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_underline_bottom_active.png b/ash/resources/default_100_percent/common/launcher/launcher_underline_bottom_active.png
deleted file mode 100644
index bdf9f4e75c..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_underline_bottom_active.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_underline_bottom_hover.png b/ash/resources/default_100_percent/common/launcher/launcher_underline_bottom_hover.png
deleted file mode 100644
index 93dd4a1ebb..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_underline_bottom_hover.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_underline_bottom_running.png b/ash/resources/default_100_percent/common/launcher/launcher_underline_bottom_running.png
deleted file mode 100644
index ac5bccb240..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_underline_bottom_running.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_underline_left_active.png b/ash/resources/default_100_percent/common/launcher/launcher_underline_left_active.png
deleted file mode 100644
index f232976db6..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_underline_left_active.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_underline_left_hover.png b/ash/resources/default_100_percent/common/launcher/launcher_underline_left_hover.png
deleted file mode 100644
index f232976db6..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_underline_left_hover.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_underline_left_running.png b/ash/resources/default_100_percent/common/launcher/launcher_underline_left_running.png
deleted file mode 100644
index 6a4294fe58..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_underline_left_running.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_underline_right_active.png b/ash/resources/default_100_percent/common/launcher/launcher_underline_right_active.png
deleted file mode 100644
index 82572f20ca..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_underline_right_active.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_underline_right_hover.png b/ash/resources/default_100_percent/common/launcher/launcher_underline_right_hover.png
deleted file mode 100644
index 82572f20ca..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_underline_right_hover.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_underline_right_running.png b/ash/resources/default_100_percent/common/launcher/launcher_underline_right_running.png
deleted file mode 100644
index 24de3c042f..0000000000
--- a/ash/resources/default_100_percent/common/launcher/launcher_underline_right_running.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/shelf/settings_app_icon.png b/ash/resources/default_100_percent/common/shelf/settings_app_icon.png
new file mode 100644
index 0000000000..9682a9b557
--- /dev/null
+++ b/ash/resources/default_100_percent/common/shelf/settings_app_icon.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/launcher_background.png b/ash/resources/default_100_percent/common/shelf/shelf_background.png
index 45b06ed746..45b06ed746 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/launcher_background.png
+++ b/ash/resources/default_100_percent/common/shelf/shelf_background.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_corner.png b/ash/resources/default_100_percent/common/shelf/shelf_corner.png
index 929c380626..929c380626 100644
--- a/ash/resources/default_100_percent/common/launcher/launcher_corner.png
+++ b/ash/resources/default_100_percent/common/shelf/shelf_corner.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_dimming.png b/ash/resources/default_100_percent/common/shelf/shelf_dimming.png
index cead58f8d5..cead58f8d5 100644
--- a/ash/resources/default_100_percent/common/launcher/launcher_dimming.png
+++ b/ash/resources/default_100_percent/common/shelf/shelf_dimming.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/launcher_overflow.png b/ash/resources/default_100_percent/common/shelf/shelf_overflow.png
index 05cc71d077..05cc71d077 100644
--- a/ash/resources/default_100_percent/common/launcher/launcher_overflow.png
+++ b/ash/resources/default_100_percent/common/shelf/shelf_overflow.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/launcher_underline_active.png b/ash/resources/default_100_percent/common/shelf/shelf_underline_active.png
index 6a69d17bde..6a69d17bde 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/launcher_underline_active.png
+++ b/ash/resources/default_100_percent/common/shelf/shelf_underline_active.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/launcher_underline_running.png b/ash/resources/default_100_percent/common/shelf/shelf_underline_running.png
index 9bcff86ef7..9bcff86ef7 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/launcher_underline_running.png
+++ b/ash/resources/default_100_percent/common/shelf/shelf_underline_running.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_app_menu_icon.png b/ash/resources/default_100_percent/common/shelf/status_app_menu_icon.png
index 5e5f18b4f5..5e5f18b4f5 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_app_menu_icon.png
+++ b/ash/resources/default_100_percent/common/shelf/status_app_menu_icon.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_icon_background_normal.png b/ash/resources/default_100_percent/common/shelf/status_icon_background_normal.png
index 565c5010dd..565c5010dd 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_icon_background_normal.png
+++ b/ash/resources/default_100_percent/common/shelf/status_icon_background_normal.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_icon_background_onblack_normal.png b/ash/resources/default_100_percent/common/shelf/status_icon_background_onblack_normal.png
index 41ba35c526..41ba35c526 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_icon_background_onblack_normal.png
+++ b/ash/resources/default_100_percent/common/shelf/status_icon_background_onblack_normal.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_icon_background_pressed.png b/ash/resources/default_100_percent/common/shelf/status_icon_background_pressed.png
index d8cdd77291..d8cdd77291 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_icon_background_pressed.png
+++ b/ash/resources/default_100_percent/common/shelf/status_icon_background_pressed.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_notification_icon.png b/ash/resources/default_100_percent/common/shelf/status_notification_icon.png
index a22e136146..a22e136146 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_notification_icon.png
+++ b/ash/resources/default_100_percent/common/shelf/status_notification_icon.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_center.png b/ash/resources/default_100_percent/common/shelf/status_tray_normal_center.png
index 7f895ba31f..7f895ba31f 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_center.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_normal_center.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_left.png b/ash/resources/default_100_percent/common/shelf/status_tray_normal_left.png
index 8b00443089..8b00443089 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_left.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_normal_left.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_onblack_center.png b/ash/resources/default_100_percent/common/shelf/status_tray_normal_onblack_center.png
index 0d26eb2d52..0d26eb2d52 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_onblack_center.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_normal_onblack_center.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_onblack_left.png b/ash/resources/default_100_percent/common/shelf/status_tray_normal_onblack_left.png
index 3484127199..3484127199 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_onblack_left.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_normal_onblack_left.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_onblack_right.png b/ash/resources/default_100_percent/common/shelf/status_tray_normal_onblack_right.png
index 5787128a60..5787128a60 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_onblack_right.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_normal_onblack_right.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_right.png b/ash/resources/default_100_percent/common/shelf/status_tray_normal_right.png
index 850e80f2b8..850e80f2b8 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_normal_right.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_normal_right.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_pressed_center.png b/ash/resources/default_100_percent/common/shelf/status_tray_pressed_center.png
index 3eb461d3b8..3eb461d3b8 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_pressed_center.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_pressed_center.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_pressed_left.png b/ash/resources/default_100_percent/common/shelf/status_tray_pressed_left.png
index 3c97b3e2fa..3c97b3e2fa 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_pressed_left.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_pressed_left.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_pressed_right.png b/ash/resources/default_100_percent/common/shelf/status_tray_pressed_right.png
index 8ec72272d0..8ec72272d0 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_pressed_right.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_pressed_right.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_bottom.png b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_bottom.png
index 0b6bd70310..0b6bd70310 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_bottom.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_bottom.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_center.png b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_center.png
index 91674cc42f..91674cc42f 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_center.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_center.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_onblack_bottom.png b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_onblack_bottom.png
index 2b1b659093..2b1b659093 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_onblack_bottom.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_onblack_bottom.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_onblack_center.png b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_onblack_center.png
index 9e3bb3cdc7..9e3bb3cdc7 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_onblack_center.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_onblack_center.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_onblack_top.png b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_onblack_top.png
index d59b1ef1d8..d59b1ef1d8 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_onblack_top.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_onblack_top.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_top.png b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_top.png
index e0e0c5ac12..e0e0c5ac12 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_normal_top.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_normal_top.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_pressed_bottom.png b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_pressed_bottom.png
index b2762ba13d..b2762ba13d 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_pressed_bottom.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_pressed_bottom.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_pressed_center.png b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_pressed_center.png
index 7727193204..7727193204 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_pressed_center.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_pressed_center.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_pressed_top.png b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_pressed_top.png
index 96453a6f57..96453a6f57 100644
--- a/ash/resources/default_100_percent/common/alt_launcher/status_tray_vertical_pressed_top.png
+++ b/ash/resources/default_100_percent/common/shelf/status_tray_vertical_pressed_top.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/task_manager.png b/ash/resources/default_100_percent/common/shelf/task_manager.png
index 293bc76900..293bc76900 100644
--- a/ash/resources/default_100_percent/common/launcher/task_manager.png
+++ b/ash/resources/default_100_percent/common/shelf/task_manager.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/window_switcher_icon_incognito.png b/ash/resources/default_100_percent/common/shelf/window_switcher_icon_incognito.png
index 47ed4cd55b..47ed4cd55b 100644
--- a/ash/resources/default_100_percent/common/launcher/window_switcher_icon_incognito.png
+++ b/ash/resources/default_100_percent/common/shelf/window_switcher_icon_incognito.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/launcher/window_switcher_icon_normal.png b/ash/resources/default_100_percent/common/shelf/window_switcher_icon_normal.png
index cb0656cfe3..cb0656cfe3 100644
--- a/ash/resources/default_100_percent/common/launcher/window_switcher_icon_normal.png
+++ b/ash/resources/default_100_percent/common/shelf/window_switcher_icon_normal.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/window_control_icon_close.png b/ash/resources/default_100_percent/common/window_control_icon_close.png
index c859299c45..9d28237a67 100644
--- a/ash/resources/default_100_percent/common/window_control_icon_close.png
+++ b/ash/resources/default_100_percent/common/window_control_icon_close.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/window_control_icon_close_inactive.png b/ash/resources/default_100_percent/common/window_control_icon_close_inactive.png
index c3084912bc..dba91d5079 100644
--- a/ash/resources/default_100_percent/common/window_control_icon_close_inactive.png
+++ b/ash/resources/default_100_percent/common/window_control_icon_close_inactive.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/window_control_icon_left_snapped.png b/ash/resources/default_100_percent/common/window_control_icon_left_snapped.png
index f95dc6614c..67561f1b60 100644
--- a/ash/resources/default_100_percent/common/window_control_icon_left_snapped.png
+++ b/ash/resources/default_100_percent/common/window_control_icon_left_snapped.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/window_control_icon_minimize_inactive.png b/ash/resources/default_100_percent/common/window_control_icon_minimize_inactive.png
index 3e9b6a7e5c..6f0837d19e 100644
--- a/ash/resources/default_100_percent/common/window_control_icon_minimize_inactive.png
+++ b/ash/resources/default_100_percent/common/window_control_icon_minimize_inactive.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/window_control_icon_right_snapped.png b/ash/resources/default_100_percent/common/window_control_icon_right_snapped.png
index 13603a52c0..3a4f15e864 100644
--- a/ash/resources/default_100_percent/common/window_control_icon_right_snapped.png
+++ b/ash/resources/default_100_percent/common/window_control_icon_right_snapped.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/window_control_icon_size_inactive.png b/ash/resources/default_100_percent/common/window_control_icon_size_inactive.png
index 4cfa19af71..c1fb86291f 100644
--- a/ash/resources/default_100_percent/common/window_control_icon_size_inactive.png
+++ b/ash/resources/default_100_percent/common/window_control_icon_size_inactive.png
Binary files differ
diff --git a/ash/resources/default_100_percent/cros/status/status_managed.png b/ash/resources/default_100_percent/cros/status/status_managed.png
index 88155e7537..4ce3c231ec 100644
--- a/ash/resources/default_100_percent/cros/status/status_managed.png
+++ b/ash/resources/default_100_percent/cros/status/status_managed.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_appmenu.png b/ash/resources/default_200_percent/common/launcher/launcher_appmenu.png
deleted file mode 100644
index 8a3ba66a00..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_appmenu.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_appmenu_hover.png b/ash/resources/default_200_percent/common/launcher/launcher_appmenu_hover.png
deleted file mode 100644
index 7762f27b06..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_appmenu_hover.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_appmenu_pressed.png b/ash/resources/default_200_percent/common/launcher/launcher_appmenu_pressed.png
deleted file mode 100644
index 82ca4b26f1..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_appmenu_pressed.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_background.png b/ash/resources/default_200_percent/common/launcher/launcher_background.png
deleted file mode 100644
index 3a3e6a1744..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_background.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_background_left.png b/ash/resources/default_200_percent/common/launcher/launcher_background_left.png
deleted file mode 100644
index 165f6b8f3c..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_background_left.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_background_right.png b/ash/resources/default_200_percent/common/launcher/launcher_background_right.png
deleted file mode 100644
index 593780b98a..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_background_right.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_dimming_left.png b/ash/resources/default_200_percent/common/launcher/launcher_dimming_left.png
deleted file mode 100644
index 30d20e8794..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_dimming_left.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_dimming_right.png b/ash/resources/default_200_percent/common/launcher/launcher_dimming_right.png
deleted file mode 100644
index 72f5a6f4dd..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_dimming_right.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_underline_bottom_active.png b/ash/resources/default_200_percent/common/launcher/launcher_underline_bottom_active.png
deleted file mode 100644
index 21181153dc..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_underline_bottom_active.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_underline_bottom_hover.png b/ash/resources/default_200_percent/common/launcher/launcher_underline_bottom_hover.png
deleted file mode 100644
index 4062f829e7..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_underline_bottom_hover.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_underline_bottom_running.png b/ash/resources/default_200_percent/common/launcher/launcher_underline_bottom_running.png
deleted file mode 100644
index 7b7e3e2d65..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_underline_bottom_running.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_underline_left_active.png b/ash/resources/default_200_percent/common/launcher/launcher_underline_left_active.png
deleted file mode 100644
index c2937e7edc..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_underline_left_active.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_underline_left_hover.png b/ash/resources/default_200_percent/common/launcher/launcher_underline_left_hover.png
deleted file mode 100644
index c2937e7edc..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_underline_left_hover.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_underline_left_running.png b/ash/resources/default_200_percent/common/launcher/launcher_underline_left_running.png
deleted file mode 100644
index d7ac0494e5..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_underline_left_running.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_underline_right_active.png b/ash/resources/default_200_percent/common/launcher/launcher_underline_right_active.png
deleted file mode 100644
index 2f9ac00c25..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_underline_right_active.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_underline_right_hover.png b/ash/resources/default_200_percent/common/launcher/launcher_underline_right_hover.png
deleted file mode 100644
index 2f9ac00c25..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_underline_right_hover.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_underline_right_running.png b/ash/resources/default_200_percent/common/launcher/launcher_underline_right_running.png
deleted file mode 100644
index 8fade1943d..0000000000
--- a/ash/resources/default_200_percent/common/launcher/launcher_underline_right_running.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/shelf/settings_app_icon.png b/ash/resources/default_200_percent/common/shelf/settings_app_icon.png
new file mode 100644
index 0000000000..716b9cf94d
--- /dev/null
+++ b/ash/resources/default_200_percent/common/shelf/settings_app_icon.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/launcher_background.png b/ash/resources/default_200_percent/common/shelf/shelf_background.png
index 5a6220414a..5a6220414a 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/launcher_background.png
+++ b/ash/resources/default_200_percent/common/shelf/shelf_background.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_corner.png b/ash/resources/default_200_percent/common/shelf/shelf_corner.png
index f354c533d4..f354c533d4 100644
--- a/ash/resources/default_200_percent/common/launcher/launcher_corner.png
+++ b/ash/resources/default_200_percent/common/shelf/shelf_corner.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_dimming.png b/ash/resources/default_200_percent/common/shelf/shelf_dimming.png
index 6843219c71..6843219c71 100644
--- a/ash/resources/default_200_percent/common/launcher/launcher_dimming.png
+++ b/ash/resources/default_200_percent/common/shelf/shelf_dimming.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/launcher_overflow.png b/ash/resources/default_200_percent/common/shelf/shelf_overflow.png
index bddc06cb7c..bddc06cb7c 100644
--- a/ash/resources/default_200_percent/common/launcher/launcher_overflow.png
+++ b/ash/resources/default_200_percent/common/shelf/shelf_overflow.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/launcher_underline_active.png b/ash/resources/default_200_percent/common/shelf/shelf_underline_active.png
index f89d8f5e2f..f89d8f5e2f 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/launcher_underline_active.png
+++ b/ash/resources/default_200_percent/common/shelf/shelf_underline_active.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/launcher_underline_running.png b/ash/resources/default_200_percent/common/shelf/shelf_underline_running.png
index ede3d2d75a..ede3d2d75a 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/launcher_underline_running.png
+++ b/ash/resources/default_200_percent/common/shelf/shelf_underline_running.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_app_menu_icon.png b/ash/resources/default_200_percent/common/shelf/status_app_menu_icon.png
index 2e1a70f7dc..2e1a70f7dc 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_app_menu_icon.png
+++ b/ash/resources/default_200_percent/common/shelf/status_app_menu_icon.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_icon_background_normal.png b/ash/resources/default_200_percent/common/shelf/status_icon_background_normal.png
index cc2d1b75cc..cc2d1b75cc 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_icon_background_normal.png
+++ b/ash/resources/default_200_percent/common/shelf/status_icon_background_normal.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_icon_background_onblack_normal.png b/ash/resources/default_200_percent/common/shelf/status_icon_background_onblack_normal.png
index 55bac5893e..55bac5893e 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_icon_background_onblack_normal.png
+++ b/ash/resources/default_200_percent/common/shelf/status_icon_background_onblack_normal.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_icon_background_pressed.png b/ash/resources/default_200_percent/common/shelf/status_icon_background_pressed.png
index 498b80bce2..498b80bce2 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_icon_background_pressed.png
+++ b/ash/resources/default_200_percent/common/shelf/status_icon_background_pressed.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_notification_icon.png b/ash/resources/default_200_percent/common/shelf/status_notification_icon.png
index 19322c5c06..19322c5c06 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_notification_icon.png
+++ b/ash/resources/default_200_percent/common/shelf/status_notification_icon.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_center.png b/ash/resources/default_200_percent/common/shelf/status_tray_normal_center.png
index 9b072370ab..9b072370ab 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_center.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_normal_center.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_left.png b/ash/resources/default_200_percent/common/shelf/status_tray_normal_left.png
index dba3b692b4..dba3b692b4 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_left.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_normal_left.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_onblack_center.png b/ash/resources/default_200_percent/common/shelf/status_tray_normal_onblack_center.png
index ea177511b8..ea177511b8 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_onblack_center.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_normal_onblack_center.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_onblack_left.png b/ash/resources/default_200_percent/common/shelf/status_tray_normal_onblack_left.png
index ff4e1efe73..ff4e1efe73 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_onblack_left.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_normal_onblack_left.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_onblack_right.png b/ash/resources/default_200_percent/common/shelf/status_tray_normal_onblack_right.png
index 9284fa8f83..9284fa8f83 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_onblack_right.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_normal_onblack_right.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_right.png b/ash/resources/default_200_percent/common/shelf/status_tray_normal_right.png
index bb129f5bf5..bb129f5bf5 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_normal_right.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_normal_right.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_pressed_center.png b/ash/resources/default_200_percent/common/shelf/status_tray_pressed_center.png
index 953e1edd36..953e1edd36 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_pressed_center.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_pressed_center.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_pressed_left.png b/ash/resources/default_200_percent/common/shelf/status_tray_pressed_left.png
index 8c6f84c003..8c6f84c003 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_pressed_left.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_pressed_left.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_pressed_right.png b/ash/resources/default_200_percent/common/shelf/status_tray_pressed_right.png
index 27207a1383..27207a1383 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_pressed_right.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_pressed_right.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_bottom.png b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_bottom.png
index 0804518dfd..0804518dfd 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_bottom.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_bottom.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_center.png b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_center.png
index 96859ea682..96859ea682 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_center.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_center.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_onblack_bottom.png b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_onblack_bottom.png
index 85bd1f1e76..85bd1f1e76 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_onblack_bottom.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_onblack_bottom.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_onblack_center.png b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_onblack_center.png
index d880b32eec..d880b32eec 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_onblack_center.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_onblack_center.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_onblack_top.png b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_onblack_top.png
index 18848265b7..18848265b7 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_onblack_top.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_onblack_top.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_top.png b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_top.png
index fed0cab22d..fed0cab22d 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_normal_top.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_normal_top.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_pressed_bottom.png b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_pressed_bottom.png
index 53b3a0d205..53b3a0d205 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_pressed_bottom.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_pressed_bottom.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_pressed_center.png b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_pressed_center.png
index 4ec633ff51..4ec633ff51 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_pressed_center.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_pressed_center.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_pressed_top.png b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_pressed_top.png
index e47b08106d..e47b08106d 100644
--- a/ash/resources/default_200_percent/common/alt_launcher/status_tray_vertical_pressed_top.png
+++ b/ash/resources/default_200_percent/common/shelf/status_tray_vertical_pressed_top.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/task_manager.png b/ash/resources/default_200_percent/common/shelf/task_manager.png
index 63b1821317..63b1821317 100644
--- a/ash/resources/default_200_percent/common/launcher/task_manager.png
+++ b/ash/resources/default_200_percent/common/shelf/task_manager.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/window_switcher_icon_incognito.png b/ash/resources/default_200_percent/common/shelf/window_switcher_icon_incognito.png
index d1ab17c6ee..d1ab17c6ee 100644
--- a/ash/resources/default_200_percent/common/launcher/window_switcher_icon_incognito.png
+++ b/ash/resources/default_200_percent/common/shelf/window_switcher_icon_incognito.png
Binary files differ
diff --git a/ash/resources/default_200_percent/common/launcher/window_switcher_icon_normal.png b/ash/resources/default_200_percent/common/shelf/window_switcher_icon_normal.png
index a718a458b8..a718a458b8 100644
--- a/ash/resources/default_200_percent/common/launcher/window_switcher_icon_normal.png
+++ b/ash/resources/default_200_percent/common/shelf/window_switcher_icon_normal.png
Binary files differ
diff --git a/ash/resources/default_200_percent/cros/status/status_managed.png b/ash/resources/default_200_percent/cros/status/status_managed.png
index 19161c10e4..5e12092863 100644
--- a/ash/resources/default_200_percent/cros/status/status_managed.png
+++ b/ash/resources/default_200_percent/cros/status/status_managed.png
Binary files differ
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 3d4a839aba..ba38e14a8d 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -33,6 +33,7 @@
#include "ash/touch/touch_observer_hud.h"
#include "ash/wm/always_on_top_controller.h"
#include "ash/wm/dock/docked_window_layout_manager.h"
+#include "ash/wm/panels/attached_panel_window_targeter.h"
#include "ash/wm/panels/panel_layout_manager.h"
#include "ash/wm/panels/panel_window_event_handler.h"
#include "ash/wm/root_window_layout_manager.h"
@@ -156,7 +157,6 @@ void ReparentAllWindows(aura::Window* src, aura::Window* dst) {
kShellWindowId_AlwaysOnTopContainer,
kShellWindowId_SystemModalContainer,
kShellWindowId_LockSystemModalContainer,
- kShellWindowId_InputMethodContainer,
kShellWindowId_UnparentedControlContainer, };
for (size_t i = 0; i < arraysize(kContainerIdsToMove); i++) {
int id = kContainerIdsToMove[i];
@@ -415,6 +415,9 @@ void RootWindowController::OnShelfCreated() {
if (shelf_->shelf_layout_manager())
docked_layout_manager_->AddObserver(shelf_->shelf_layout_manager());
}
+
+ // Notify shell observers that the shelf has been created.
+ Shell::GetInstance()->OnShelfCreatedForRootWindow(GetRootWindow());
}
void RootWindowController::UpdateAfterLoginStatusChange(
@@ -785,6 +788,20 @@ void RootWindowController::InitLayoutManagers() {
panel_container->SetLayoutManager(panel_layout_manager_);
panel_container_handler_.reset(new PanelWindowEventHandler);
panel_container->AddPreTargetHandler(panel_container_handler_.get());
+
+ // Install an AttachedPanelWindowTargeter on the panel container to make it
+ // easier to correctly target shelf buttons with touch.
+ gfx::Insets mouse_extend(-kResizeOutsideBoundsSize,
+ -kResizeOutsideBoundsSize,
+ -kResizeOutsideBoundsSize,
+ -kResizeOutsideBoundsSize);
+ gfx::Insets touch_extend = mouse_extend.Scale(
+ kResizeOutsideBoundsScaleForTouch);
+ panel_container->SetEventTargeter(scoped_ptr<ui::EventTargeter>(
+ new AttachedPanelWindowTargeter(panel_container,
+ mouse_extend,
+ touch_extend,
+ panel_layout_manager_)));
}
void RootWindowController::InitTouchHuds() {
@@ -894,7 +911,6 @@ void RootWindowController::CreateContainersInRootWindow(
"PanelContainer",
non_lock_screen_containers);
SetUsesScreenCoordinates(panel_container);
- SetUsesEasyResizeTargeter(panel_container);
aura::Window* shelf_bubble_container =
CreateContainer(kShellWindowId_ShelfBubbleContainer,
@@ -919,13 +935,6 @@ void RootWindowController::CreateContainersInRootWindow(
SetUsesScreenCoordinates(modal_container);
SetUsesEasyResizeTargeter(modal_container);
- aura::Window* input_method_container = CreateContainer(
- kShellWindowId_InputMethodContainer,
- "InputMethodContainer",
- non_lock_screen_containers);
- ::wm::SetChildWindowVisibilityChangesAnimated(input_method_container);
- SetUsesScreenCoordinates(input_method_container);
-
// TODO(beng): Figure out if we can make this use
// SystemModalContainerEventFilter instead of stops_event_propagation.
aura::Window* lock_container = CreateContainer(
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index 69aad6b7d4..99c340d81c 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -28,6 +28,7 @@
#include "ui/events/test/test_event_handler.h"
#include "ui/keyboard/keyboard_controller_proxy.h"
#include "ui/keyboard/keyboard_switches.h"
+#include "ui/keyboard/keyboard_util.h"
#include "ui/views/controls/menu/menu_controller.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
@@ -653,13 +654,13 @@ TEST_F(VirtualKeyboardRootWindowControllerTest,
keyboard_window->SetBounds(gfx::Rect());
keyboard_window->Show();
- ui::test::TestEventHandler* handler = new ui::test::TestEventHandler;
- root_window->SetEventFilter(handler);
+ ui::test::TestEventHandler handler;
+ root_window->AddPreTargetHandler(&handler);
aura::test::EventGenerator event_generator(root_window, keyboard_window);
event_generator.ClickLeftButton();
int expected_mouse_presses = 1;
- EXPECT_EQ(expected_mouse_presses, handler->num_mouse_events() / 2);
+ EXPECT_EQ(expected_mouse_presses, handler.num_mouse_events() / 2);
for (int block_reason = FIRST_BLOCK_REASON;
block_reason < NUMBER_OF_BLOCK_REASONS;
@@ -667,9 +668,10 @@ TEST_F(VirtualKeyboardRootWindowControllerTest,
BlockUserSession(static_cast<UserSessionBlockReason>(block_reason));
event_generator.ClickLeftButton();
expected_mouse_presses++;
- EXPECT_EQ(expected_mouse_presses, handler->num_mouse_events() / 2);
+ EXPECT_EQ(expected_mouse_presses, handler.num_mouse_events() / 2);
UnblockUserSession();
}
+ root_window->RemovePreTargetHandler(&handler);
}
// Test for http://crbug.com/299787. RootWindowController should delete
@@ -702,6 +704,8 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, RestoreWorkspaceAfterLogin) {
aura::Window* keyboard_window = controller->proxy()->GetKeyboardWindow();
keyboard_container->AddChild(keyboard_window);
keyboard_window->set_owned_by_parent(false);
+ keyboard_window->SetBounds(keyboard::KeyboardBoundsFromWindowBounds(
+ keyboard_container->bounds(), 100));
keyboard_window->Show();
gfx::Rect before = ash::Shell::GetScreen()->GetPrimaryDisplay().work_area();
@@ -731,11 +735,11 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, ClickWithActiveModalDialog) {
proxy()->GetKeyboardWindow();
keyboard_container->AddChild(keyboard_window);
keyboard_window->set_owned_by_parent(false);
- keyboard_window->SetBounds(gfx::Rect());
- keyboard_window->Show();
+ keyboard_window->SetBounds(keyboard::KeyboardBoundsFromWindowBounds(
+ keyboard_container->bounds(), 100));
- ui::test::TestEventHandler* handler = new ui::test::TestEventHandler;
- root_window->SetEventFilter(handler);
+ ui::test::TestEventHandler handler;
+ root_window->AddPreTargetHandler(&handler);
aura::test::EventGenerator root_window_event_generator(root_window);
aura::test::EventGenerator keyboard_event_generator(root_window,
keyboard_window);
@@ -746,17 +750,18 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, ClickWithActiveModalDialog) {
// Verify that mouse events to the root window are block with a visble modal
// dialog.
root_window_event_generator.ClickLeftButton();
- EXPECT_EQ(0, handler->num_mouse_events());
+ EXPECT_EQ(0, handler.num_mouse_events());
// Verify that event dispatch to the virtual keyboard is unblocked.
keyboard_event_generator.ClickLeftButton();
- EXPECT_EQ(1, handler->num_mouse_events() / 2);
+ EXPECT_EQ(1, handler.num_mouse_events() / 2);
modal_widget->Close();
// Verify that mouse events are now unblocked to the root window.
root_window_event_generator.ClickLeftButton();
- EXPECT_EQ(2, handler->num_mouse_events() / 2);
+ EXPECT_EQ(2, handler.num_mouse_events() / 2);
+ root_window->RemovePreTargetHandler(&handler);
}
} // namespace test
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 789c884c5c..093d38b74e 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -1028,7 +1028,9 @@ ShelfAutoHideState ShelfLayoutManager::CalculateAutoHideState(
if (shelf_->shelf() && shelf_->shelf()->IsShowingOverflowBubble())
return SHELF_AUTO_HIDE_SHOWN;
- if (shelf_->IsActive() || shelf_->status_area_widget()->IsActive())
+ if (shelf_->IsActive() ||
+ (shelf_->status_area_widget() &&
+ shelf_->status_area_widget()->IsActive()))
return SHELF_AUTO_HIDE_SHOWN;
const std::vector<aura::Window*> windows =
diff --git a/ash/shell.cc b/ash/shell.cc
index 6891419d35..e6946308f7 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -132,7 +132,7 @@
#include "ash/system/chromeos/session/logout_confirmation_controller.h"
#include "base/bind_helpers.h"
#include "base/sys_info.h"
-#include "ui/chromeos/user_activity_notifier.h"
+#include "ui/chromeos/user_activity_power_manager_notifier.h"
#include "ui/display/chromeos/display_configurator.h"
#endif // defined(OS_CHROMEOS)
@@ -407,6 +407,12 @@ void Shell::CreateShelf() {
(*iter)->shelf()->CreateShelf();
}
+void Shell::OnShelfCreatedForRootWindow(aura::Window* root_window) {
+ FOR_EACH_OBSERVER(ShellObserver,
+ observers_,
+ OnShelfCreatedForRootWindow(root_window));
+}
+
void Shell::CreateKeyboard() {
// TODO(bshe): Primary root window controller may not be the controller to
// attach virtual keyboard. See http://crbug.com/303429
@@ -1001,7 +1007,7 @@ void Shell::Init() {
power_event_observer_.reset(new PowerEventObserver());
user_activity_notifier_.reset(
- new ui::UserActivityNotifier(user_activity_detector_.get()));
+ new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get()));
video_activity_notifier_.reset(
new VideoActivityNotifier(video_detector_.get()));
bluetooth_notification_controller_.reset(new BluetoothNotificationController);
diff --git a/ash/shell.h b/ash/shell.h
index 56af8d1afe..6f88e1d873 100644
--- a/ash/shell.h
+++ b/ash/shell.h
@@ -51,7 +51,7 @@ class Rect;
namespace ui {
class DisplayConfigurator;
class Layer;
-class UserActivityNotifier;
+class UserActivityPowerManagerNotifier;
}
namespace views {
class NonClientFrameView;
@@ -307,6 +307,9 @@ class ASH_EXPORT Shell : public SystemModalContainerEventFilterDelegate,
// Initializes |shelf_|. Does nothing if it's already initialized.
void CreateShelf();
+ // Called when the shelf is created for |root_window|.
+ void OnShelfCreatedForRootWindow(aura::Window* root_window);
+
// Creates a virtual keyboard. Deletes the old virtual keyboard if it already
// exists.
void CreateKeyboard();
@@ -689,7 +692,7 @@ class ASH_EXPORT Shell : public SystemModalContainerEventFilterDelegate,
#if defined(OS_CHROMEOS)
scoped_ptr<PowerEventObserver> power_event_observer_;
- scoped_ptr<ui::UserActivityNotifier> user_activity_notifier_;
+ scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;
scoped_ptr<VideoActivityNotifier> video_activity_notifier_;
scoped_ptr<StickyKeysController> sticky_keys_controller_;
scoped_ptr<ResolutionNotificationController>
diff --git a/ash/shell_observer.h b/ash/shell_observer.h
index 8c393d370e..35b255560d 100644
--- a/ash/shell_observer.h
+++ b/ash/shell_observer.h
@@ -32,6 +32,9 @@ class ASH_EXPORT ShellObserver {
// Invoked after a non-primary root window is created.
virtual void OnRootWindowAdded(aura::Window* root_window) {}
+ // Invoked after the shelf has been created for |root_window|.
+ virtual void OnShelfCreatedForRootWindow(aura::Window* root_window) {}
+
// Invoked when the shelf alignment in |root_window| is changed.
virtual void OnShelfAlignmentChanged(aura::Window* root_window) {}
diff --git a/ash/shell_window_ids.h b/ash/shell_window_ids.h
index a4bd516c4e..f01e74b371 100644
--- a/ash/shell_window_ids.h
+++ b/ash/shell_window_ids.h
@@ -61,50 +61,45 @@ const int kShellWindowId_AppListContainer = 12;
// The container for user-specific modal windows.
const int kShellWindowId_SystemModalContainer = 13;
-// The container for input method components such like candidate windows. They
-// are almost panels but have no activations/focus, and they should appear over
-// the AppList and SystemModal dialogs.
-const int kShellWindowId_InputMethodContainer = 14;
-
// The container for the lock screen background.
-const int kShellWindowId_LockScreenBackgroundContainer = 15;
+const int kShellWindowId_LockScreenBackgroundContainer = 14;
// The container for the lock screen.
-const int kShellWindowId_LockScreenContainer = 16;
+const int kShellWindowId_LockScreenContainer = 15;
// The container for the lock screen modal windows.
-const int kShellWindowId_LockSystemModalContainer = 17;
+const int kShellWindowId_LockSystemModalContainer = 16;
// The container for the status area.
-const int kShellWindowId_StatusContainer = 18;
+const int kShellWindowId_StatusContainer = 17;
// The container for menus.
-const int kShellWindowId_MenuContainer = 19;
+const int kShellWindowId_MenuContainer = 18;
// The container for drag/drop images and tooltips.
-const int kShellWindowId_DragImageAndTooltipContainer = 20;
+const int kShellWindowId_DragImageAndTooltipContainer = 19;
// The container for bubbles briefly overlaid onscreen to show settings changes
-// (volume, brightness, etc.).
-const int kShellWindowId_SettingBubbleContainer = 21;
+// (volume, brightness, input method bubbles, etc.).
+const int kShellWindowId_SettingBubbleContainer = 20;
// The container for special components overlaid onscreen, such as the
// region selector for partial screenshots.
-const int kShellWindowId_OverlayContainer = 22;
+const int kShellWindowId_OverlayContainer = 21;
// ID of the window created by PhantomWindowController or DragWindowController.
-const int kShellWindowId_PhantomWindow = 23;
+const int kShellWindowId_PhantomWindow = 22;
// A parent container that holds the virtual keyboard container. This is to
// ensure that the virtual keyboard is stacked above most containers but below
// the mouse cursor and the power off animation.
-const int kShellWindowId_VirtualKeyboardParentContainer = 24;
+const int kShellWindowId_VirtualKeyboardParentContainer = 23;
// The container for mouse cursor.
-const int kShellWindowId_MouseCursorContainer = 25;
+const int kShellWindowId_MouseCursorContainer = 24;
// The topmost container, used for power off animation.
-const int kShellWindowId_PowerButtonAnimationContainer = 26;
+const int kShellWindowId_PowerButtonAnimationContainer = 25;
} // namespace ash
diff --git a/ash/strings/ash_strings_fi.xtb b/ash/strings/ash_strings_fi.xtb
index 14a1def478..bb1139f584 100644
--- a/ash/strings/ash_strings_fi.xtb
+++ b/ash/strings/ash_strings_fi.xtb
@@ -74,7 +74,7 @@ Vaihda syöttötapaa painamalla Shift + Alt.</translation>
<translation id="2688477613306174402">Määritykset</translation>
<translation id="1272079795634619415">Pysäytä</translation>
<translation id="4957722034734105353">Lisätietoja...</translation>
-<translation id="2964193600955408481">Wifi pois käytöstä</translation>
+<translation id="2964193600955408481">Wi-Fi pois käytöstä</translation>
<translation id="4279490309300973883">Peilaus päällä</translation>
<translation id="7973962044839454485">PPP-todennus epäonnistui virheellisen käyttäjänimen tai salasanan vuoksi</translation>
<translation id="2509468283778169019">CAPS LOCK on päällä</translation>
@@ -137,7 +137,7 @@ Vaihda syöttötapaa painamalla Shift + Alt.</translation>
<translation id="1957803754585243749">0°</translation>
<translation id="2354174487190027830">Aktivoidaan <ph name="NAME"/></translation>
<translation id="4527045527269911712">Bluetooth-laite <ph name="DEVICE_NAME"/> pyytää lupaa laiteparin muodostamiseen.</translation>
-<translation id="8814190375133053267">Wifi</translation>
+<translation id="8814190375133053267">Wi-Fi</translation>
<translation id="1923539912171292317">Automaattiset klikkaukset</translation>
<translation id="1398853756734560583">Suurenna</translation>
<translation id="2692809339924654275"><ph name="BLUETOOTH"/>: Yhdistetään…</translation>
@@ -149,7 +149,7 @@ Vaihda syöttötapaa painamalla Shift + Alt.</translation>
<translation id="2805756323405976993">Sovellukset</translation>
<translation id="1512064327686280138">Aktivointivirhe</translation>
<translation id="5097002363526479830">Yhteyden muodostaminen verkkoon &quot;<ph name="NAME"/>&quot; epäonnistui: <ph name="DETAILS"/></translation>
-<translation id="1850504506766569011">Wifi ei ole käytössä.</translation>
+<translation id="1850504506766569011">Wi-Fi ei ole käytössä.</translation>
<translation id="2872961005593481000">Sammuta</translation>
<translation id="2966449113954629791">Olet saattanut käyttää tiedonsiirtosaldosi loppuun. Käy <ph name="NAME"/>-aktivointiportaalissa ostamassa lisää saldoa.</translation>
<translation id="8132793192354020517">Yhteys muodostettu verkkoon <ph name="NAME"/></translation>
@@ -185,7 +185,7 @@ Palvelimen viesti: <ph name="SERVER_MSG"/></translation>
<translation id="9044646465488564462">Yhteyden muodostaminen verkkoon epäonnistui: <ph name="DETAILS"/></translation>
<translation id="7029814467594812963">Sulje käyttökerta</translation>
<translation id="479989351350248267">haku</translation>
-<translation id="8454013096329229812">Wifi on käytössä.</translation>
+<translation id="8454013096329229812">Wi-Fi on käytössä.</translation>
<translation id="4872237917498892622">Alt + haku tai Shift</translation>
<translation id="2429753432712299108">Bluetooth-laite <ph name="DEVICE_NAME"/> pyytää lupaa laiteparin muodostamiseen. Ennen kuin hyväksyt pyynnön, varmista, että laitteella näkyy tämä avain: <ph name="PASSKEY"/></translation>
<translation id="9201131092683066720">Akussa on virtaa <ph name="PERCENTAGE"/> %.</translation>
diff --git a/ash/system/chromeos/enterprise/tray_enterprise.cc b/ash/system/chromeos/enterprise/tray_enterprise.cc
index ecb54e4bfe..d2d2d77e8c 100644
--- a/ash/system/chromeos/enterprise/tray_enterprise.cc
+++ b/ash/system/chromeos/enterprise/tray_enterprise.cc
@@ -38,7 +38,7 @@ views::View* TrayEnterprise::CreateDefaultView(user::LoginStatus status) {
// instead.
if (status == ash::user::LOGGED_IN_PUBLIC)
return NULL;
- tray_view_ = new LabelTrayView(this, IDR_AURA_UBER_TRAY_ENTERPRISE_DARK);
+ tray_view_ = new LabelTrayView(this, IDR_AURA_UBER_TRAY_ENTERPRISE);
UpdateEnterpriseMessage();
return tray_view_;
}
diff --git a/ash/system/chromeos/power/power_event_observer.cc b/ash/system/chromeos/power/power_event_observer.cc
index 5ede06bab0..776b004b1b 100644
--- a/ash/system/chromeos/power/power_event_observer.cc
+++ b/ash/system/chromeos/power/power_event_observer.cc
@@ -54,7 +54,7 @@ void PowerEventObserver::SuspendImminent() {
shell->display_configurator()->SuspendDisplays();
}
-void PowerEventObserver::SystemResumed(const base::TimeDelta& sleep_duration) {
+void PowerEventObserver::SuspendDone(const base::TimeDelta& sleep_duration) {
Shell::GetInstance()->display_configurator()->ResumeDisplays();
Shell::GetInstance()->system_tray_notifier()->NotifyRefreshClock();
}
diff --git a/ash/system/chromeos/power/power_event_observer.h b/ash/system/chromeos/power/power_event_observer.h
index 518959b56b..46b6eb9b1c 100644
--- a/ash/system/chromeos/power/power_event_observer.h
+++ b/ash/system/chromeos/power/power_event_observer.h
@@ -26,7 +26,7 @@ class ASH_EXPORT PowerEventObserver
// chromeos::PowerManagerClient::Observer overrides:
virtual void BrightnessChanged(int level, bool user_initiated) OVERRIDE;
virtual void SuspendImminent() OVERRIDE;
- virtual void SystemResumed(const base::TimeDelta& sleep_duration) OVERRIDE;
+ virtual void SuspendDone(const base::TimeDelta& sleep_duration) OVERRIDE;
// chromeos::SessionManagerClient::Observer overrides.
virtual void ScreenIsLocked() OVERRIDE;
diff --git a/ash/system/chromeos/power/power_event_observer_unittest.cc b/ash/system/chromeos/power/power_event_observer_unittest.cc
index 94dcdedd91..30cd2e993c 100644
--- a/ash/system/chromeos/power/power_event_observer_unittest.cc
+++ b/ash/system/chromeos/power/power_event_observer_unittest.cc
@@ -53,7 +53,7 @@ TEST_F(PowerEventObserverTest, LockBeforeSuspend) {
EXPECT_EQ(0, client->GetNumPendingSuspendReadinessCallbacks());
// If the system is already locked, no callback should be requested.
- observer_->SystemResumed(base::TimeDelta());
+ observer_->SuspendDone(base::TimeDelta());
observer_->ScreenIsUnlocked();
observer_->ScreenIsLocked();
observer_->SuspendImminent();
@@ -61,7 +61,7 @@ TEST_F(PowerEventObserverTest, LockBeforeSuspend) {
// It also shouldn't request a callback if it isn't instructed to lock the
// screen.
- observer_->SystemResumed(base::TimeDelta());
+ observer_->SuspendDone(base::TimeDelta());
SetShouldLockScreenBeforeSuspending(false);
observer_->SuspendImminent();
EXPECT_EQ(0, client->GetNumPendingSuspendReadinessCallbacks());
diff --git a/ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc b/ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc
index 9eb190b5dd..2875d9ed9d 100644
--- a/ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc
+++ b/ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc
@@ -99,7 +99,7 @@ bool VirtualKeyboardTray::ClickedOutsideBubble() {
}
bool VirtualKeyboardTray::PerformAction(const ui::Event& event) {
- keyboard::KeyboardController::GetInstance()->ShowAndLockKeyboard();
+ keyboard::KeyboardController::GetInstance()->ShowKeyboard(true);
return true;
}
diff --git a/ash/system/tray/default_system_tray_delegate.cc b/ash/system/tray/default_system_tray_delegate.cc
index 1c1749d4f1..2c20da72f4 100644
--- a/ash/system/tray/default_system_tray_delegate.cc
+++ b/ash/system/tray/default_system_tray_delegate.cc
@@ -59,10 +59,6 @@ user::LoginStatus DefaultSystemTrayDelegate::GetUserLoginStatus() const {
return user::LOGGED_IN_USER;
}
-bool DefaultSystemTrayDelegate::IsOobeCompleted() const {
- return true;
-}
-
void DefaultSystemTrayDelegate::ChangeProfilePicture() {
}
diff --git a/ash/system/tray/default_system_tray_delegate.h b/ash/system/tray/default_system_tray_delegate.h
index b53301fb7f..0f0a63f797 100644
--- a/ash/system/tray/default_system_tray_delegate.h
+++ b/ash/system/tray/default_system_tray_delegate.h
@@ -22,7 +22,6 @@ class ASH_EXPORT DefaultSystemTrayDelegate : public SystemTrayDelegate {
virtual void Shutdown() OVERRIDE;
virtual bool GetTrayVisibilityOnStartup() OVERRIDE;
virtual user::LoginStatus GetUserLoginStatus() const OVERRIDE;
- virtual bool IsOobeCompleted() const OVERRIDE;
virtual void ChangeProfilePicture() OVERRIDE;
virtual const std::string GetEnterpriseDomain() const OVERRIDE;
virtual const base::string16 GetEnterpriseMessage() const OVERRIDE;
diff --git a/ash/system/tray/system_tray_delegate.h b/ash/system/tray/system_tray_delegate.h
index c492f1fbe3..7e22f2281f 100644
--- a/ash/system/tray/system_tray_delegate.h
+++ b/ash/system/tray/system_tray_delegate.h
@@ -130,7 +130,6 @@ class ASH_EXPORT SystemTrayDelegate {
// Gets information about the active user.
virtual user::LoginStatus GetUserLoginStatus() const = 0;
- virtual bool IsOobeCompleted() const = 0;
// Shows UI for changing user's profile picture.
virtual void ChangeProfilePicture() = 0;
diff --git a/ash/system/tray/system_tray_item.cc b/ash/system/tray/system_tray_item.cc
index 554c58961c..6eb03a1fab 100644
--- a/ash/system/tray/system_tray_item.cc
+++ b/ash/system/tray/system_tray_item.cc
@@ -58,9 +58,6 @@ void SystemTrayItem::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
}
void SystemTrayItem::PopupDetailedView(int for_seconds, bool activate) {
- // Never show a detailed view during OOBE, e.g. from a notification.
- if (!Shell::GetInstance()->system_tray_delegate()->IsOobeCompleted())
- return;
system_tray()->ShowDetailedView(
this, for_seconds, activate, BUBBLE_CREATE_NEW);
}
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc
index 75034c5bc5..f9e812c9c3 100644
--- a/ash/test/ash_test_helper.cc
+++ b/ash/test/ash_test_helper.cc
@@ -154,7 +154,7 @@ aura::Window* AshTestHelper::CurrentContext() {
// static
bool AshTestHelper::SupportsMultipleDisplays() {
#if defined(OS_WIN)
- return base::win::GetVersion() < base::win::VERSION_WIN8;
+ return false;
#else
return true;
#endif
@@ -163,7 +163,7 @@ bool AshTestHelper::SupportsMultipleDisplays() {
// static
bool AshTestHelper::SupportsHostWindowResize() {
#if defined(OS_WIN)
- return base::win::GetVersion() < base::win::VERSION_WIN8;
+ return false;
#else
return true;
#endif
diff --git a/ash/test/cursor_manager_test_api.cc b/ash/test/cursor_manager_test_api.cc
index 22aa261511..4ff7cf76ac 100644
--- a/ash/test/cursor_manager_test_api.cc
+++ b/ash/test/cursor_manager_test_api.cc
@@ -31,9 +31,16 @@ gfx::NativeCursor CursorManagerTestApi::GetCurrentCursor() const {
return cursor_manager_->GetCursor();
}
-gfx::Display CursorManagerTestApi::GetDisplay() const {
+gfx::Display::Rotation
+CursorManagerTestApi::GetCurrentCursorRotation() const {
return ShellTestApi(Shell::GetInstance()).ash_native_cursor_manager()->
- image_cursors_->GetDisplay();
+ image_cursors_->GetRotation();
+}
+
+float
+CursorManagerTestApi::GetCurrentCursorScale() const {
+ return ShellTestApi(Shell::GetInstance()).ash_native_cursor_manager()->
+ image_cursors_->GetScale();
}
} // namespace test
diff --git a/ash/test/cursor_manager_test_api.h b/ash/test/cursor_manager_test_api.h
index 1b9c6b82ce..fce98ca242 100644
--- a/ash/test/cursor_manager_test_api.h
+++ b/ash/test/cursor_manager_test_api.h
@@ -7,12 +7,9 @@
#include "base/basictypes.h"
#include "ui/base/cursor/cursor.h"
+#include "ui/gfx/display.h"
#include "ui/gfx/native_widget_types.h"
-namespace gfx {
-class Display;
-}
-
namespace wm {
class CursorManager;
}
@@ -28,7 +25,8 @@ class CursorManagerTestApi {
ui::CursorSetType GetCurrentCursorSet() const;
gfx::NativeCursor GetCurrentCursor() const;
- gfx::Display GetDisplay() const;
+ gfx::Display::Rotation GetCurrentCursorRotation() const;
+ float GetCurrentCursorScale() const;
private:
::wm::CursorManager* cursor_manager_;
diff --git a/ash/wm/OWNERS b/ash/wm/OWNERS
index ee007459d7..6310ae0c17 100644
--- a/ash/wm/OWNERS
+++ b/ash/wm/OWNERS
@@ -1,2 +1,3 @@
pkotwicz@chromium.org
varkha@chromium.org
+flackr@chromium.org
diff --git a/ash/wm/app_list_controller.cc b/ash/wm/app_list_controller.cc
index aaf7012267..d26ff37bcd 100644
--- a/ash/wm/app_list_controller.cc
+++ b/ash/wm/app_list_controller.cc
@@ -296,7 +296,7 @@ void AppListController::ProcessLocatedEvent(ui::LocatedEvent* event) {
}
}
- aura::Window* window = view_->GetWidget()->GetNativeView();
+ aura::Window* window = view_->GetWidget()->GetNativeView()->parent();
if (!window->Contains(target))
SetVisible(false, window);
}
diff --git a/ash/wm/ash_native_cursor_manager.cc b/ash/wm/ash_native_cursor_manager.cc
index 98078ace1c..e78eb94db2 100644
--- a/ash/wm/ash_native_cursor_manager.cc
+++ b/ash/wm/ash_native_cursor_manager.cc
@@ -95,8 +95,7 @@ void AshNativeCursorManager::SetCursor(
new_cursor.SetPlatformCursor(invisible_cursor.platform());
}
}
- new_cursor.set_device_scale_factor(
- image_cursors_->GetDisplay().device_scale_factor());
+ new_cursor.set_device_scale_factor(image_cursors_->GetScale());
delegate->CommitCursor(new_cursor);
diff --git a/ash/wm/ash_native_cursor_manager_interactive_uitest.cc b/ash/wm/ash_native_cursor_manager_interactive_uitest.cc
index 5eee024bc4..83df158964 100644
--- a/ash/wm/ash_native_cursor_manager_interactive_uitest.cc
+++ b/ash/wm/ash_native_cursor_manager_interactive_uitest.cc
@@ -102,10 +102,10 @@ TEST_F(AshNativeCursorManagerTest, MAYBE_CursorChangeOnEnterNotify) {
display_manager->OnNativeDisplaysChanged(display_info_list);
MoveMouseSync(Shell::GetAllRootWindows()[0], 10, 10);
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
MoveMouseSync(Shell::GetAllRootWindows()[0], 600, 10);
- EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
}
} // namespace ash
diff --git a/ash/wm/ash_native_cursor_manager_unittest.cc b/ash/wm/ash_native_cursor_manager_unittest.cc
index 812601fe87..5713fe3f02 100644
--- a/ash/wm/ash_native_cursor_manager_unittest.cc
+++ b/ash/wm/ash_native_cursor_manager_unittest.cc
@@ -4,6 +4,8 @@
#include "ash/wm/ash_native_cursor_manager.h"
+#include "ash/display/display_info.h"
+#include "ash/display/display_manager.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/cursor_manager_test_api.h"
@@ -54,18 +56,16 @@ typedef test::AshTestBase AshNativeCursorManagerTest;
TEST_F(AshNativeCursorManagerTest, LockCursor) {
::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
CursorManagerTestApi test_api(cursor_manager);
- gfx::Display display(0);
+
#if defined(OS_WIN)
ui::CursorLoaderWin::SetCursorResourceModule(L"ash_unittests.exe");
#endif
cursor_manager->SetCursor(ui::kCursorCopy);
EXPECT_EQ(ui::kCursorCopy, test_api.GetCurrentCursor().native_type());
- display.set_device_scale_factor(2.0f);
- display.set_rotation(gfx::Display::ROTATE_90);
- cursor_manager->SetDisplay(display);
- EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor());
+ UpdateDisplay("800x800*2/r");
+ EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
EXPECT_EQ(ui::CURSOR_SET_NORMAL, test_api.GetCurrentCursorSet());
- EXPECT_EQ(gfx::Display::ROTATE_90, test_api.GetDisplay().rotation());
+ EXPECT_EQ(gfx::Display::ROTATE_90, test_api.GetCurrentCursorRotation());
EXPECT_TRUE(test_api.GetCurrentCursor().platform());
cursor_manager->LockCursor();
@@ -85,18 +85,16 @@ TEST_F(AshNativeCursorManagerTest, LockCursor) {
EXPECT_EQ(ui::kCursorCopy, test_api.GetCurrentCursor().native_type());
// Device scale factor and rotation do change even while cursor is locked.
- display.set_device_scale_factor(1.0f);
- display.set_rotation(gfx::Display::ROTATE_180);
- cursor_manager->SetDisplay(display);
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
- EXPECT_EQ(gfx::Display::ROTATE_180, test_api.GetDisplay().rotation());
+ UpdateDisplay("800x800/u");
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
+ EXPECT_EQ(gfx::Display::ROTATE_180, test_api.GetCurrentCursorRotation());
cursor_manager->UnlockCursor();
EXPECT_FALSE(cursor_manager->IsCursorLocked());
// Cursor type changes to the one specified while cursor is locked.
EXPECT_EQ(ui::kCursorPointer, test_api.GetCurrentCursor().native_type());
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
EXPECT_TRUE(test_api.GetCurrentCursor().platform());
}
@@ -133,18 +131,47 @@ TEST_F(AshNativeCursorManagerTest, SetCursorSet) {
TEST_F(AshNativeCursorManagerTest, SetDeviceScaleFactorAndRotation) {
::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
CursorManagerTestApi test_api(cursor_manager);
+ UpdateDisplay("800x100*2");
+ EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
+ EXPECT_EQ(gfx::Display::ROTATE_0, test_api.GetCurrentCursorRotation());
+
+ UpdateDisplay("800x100/l");
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
+ EXPECT_EQ(gfx::Display::ROTATE_270, test_api.GetCurrentCursorRotation());
+}
- gfx::Display display(0);
- display.set_device_scale_factor(2.0f);
- cursor_manager->SetDisplay(display);
- EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor());
- EXPECT_EQ(gfx::Display::ROTATE_0, test_api.GetDisplay().rotation());
-
- display.set_device_scale_factor(1.0f);
- display.set_rotation(gfx::Display::ROTATE_270);
- cursor_manager->SetDisplay(display);
- EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor());
- EXPECT_EQ(gfx::Display::ROTATE_270, test_api.GetDisplay().rotation());
+TEST_F(AshNativeCursorManagerTest, UIScaleShouldNotChangeCursor) {
+ int64 display_id = Shell::GetScreen()->GetPrimaryDisplay().id();
+ gfx::Display::SetInternalDisplayId(display_id);
+
+ ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
+ CursorManagerTestApi test_api(cursor_manager);
+ DisplayManager* display_manager = Shell::GetInstance()->display_manager();
+
+ DisplayInfo::SetAllowUpgradeToHighDPI(false);
+ display_manager->SetDisplayUIScale(display_id, 0.5f);
+ EXPECT_EQ(1.0f,
+ Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
+
+ display_manager->SetDisplayUIScale(display_id, 1.0f);
+
+ DisplayInfo::SetAllowUpgradeToHighDPI(true);
+ // 1x display should keep using 1x cursor even if the DSF is upgraded to 2x.
+ display_manager->SetDisplayUIScale(display_id, 0.5f);
+ EXPECT_EQ(2.0f,
+ Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor());
+
+ // 2x display should keep using 2x cursor regardless of the UI scale.
+ UpdateDisplay("800x800*2");
+ EXPECT_EQ(2.0f,
+ Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
+ display_manager->SetDisplayUIScale(display_id, 2.0f);
+ EXPECT_EQ(1.0f,
+ Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, test_api.GetCurrentCursor().device_scale_factor());
}
TEST_F(AshNativeCursorManagerTest, DisabledQueryMouseLocation) {
diff --git a/ash/wm/default_state.cc b/ash/wm/default_state.cc
index b5aec3874d..de4c60caf4 100644
--- a/ash/wm/default_state.cc
+++ b/ash/wm/default_state.cc
@@ -477,8 +477,9 @@ void DefaultState::ReenterToCurrentState(
window_state->UpdateWindowShowStateFromStateType();
window_state->NotifyPreStateTypeChange(previous_state_type);
- if (state_type_ == wm::WINDOW_STATE_TYPE_NORMAL ||
- state_type_ == wm::WINDOW_STATE_TYPE_DEFAULT) {
+ if ((state_type_ == wm::WINDOW_STATE_TYPE_NORMAL ||
+ state_type_ == wm::WINDOW_STATE_TYPE_DEFAULT) &&
+ !stored_bounds_.IsEmpty()) {
// Use the restore mechanism to set the bounds for
// the window in normal state. This also covers unminimize case.
window_state->SetRestoreBoundsInParent(stored_bounds_);
diff --git a/ash/wm/drag_window_resizer_unittest.cc b/ash/wm/drag_window_resizer_unittest.cc
index dbb4da0a09..369a285f53 100644
--- a/ash/wm/drag_window_resizer_unittest.cc
+++ b/ash/wm/drag_window_resizer_unittest.cc
@@ -494,13 +494,13 @@ TEST_F(DragWindowResizerTest, CursorDeviceScaleFactor) {
// Grab (0, 0) of the window.
scoped_ptr<WindowResizer> resizer(CreateDragWindowResizer(
window_.get(), gfx::Point(), HTCAPTION));
- EXPECT_EQ(1.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
ASSERT_TRUE(resizer.get());
resizer->Drag(CalculateDragPoint(*resizer, 399, 200), 0);
WarpMouseCursorIfNecessary(root_windows[0], gfx::Point(399, 200));
- EXPECT_EQ(2.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
resizer->CompleteDrag();
- EXPECT_EQ(2.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
}
// Move window from the root window with 2.0 device scale factor to the root
@@ -518,13 +518,13 @@ TEST_F(DragWindowResizerTest, CursorDeviceScaleFactor) {
// Grab (0, 0) of the window.
scoped_ptr<WindowResizer> resizer(CreateDragWindowResizer(
window_.get(), gfx::Point(), HTCAPTION));
- EXPECT_EQ(2.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
ASSERT_TRUE(resizer.get());
resizer->Drag(CalculateDragPoint(*resizer, -200, 200), 0);
WarpMouseCursorIfNecessary(root_windows[1], gfx::Point(400, 200));
- EXPECT_EQ(1.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
resizer->CompleteDrag();
- EXPECT_EQ(1.0f, cursor_test_api.GetDisplay().device_scale_factor());
+ EXPECT_EQ(1.0f, cursor_test_api.GetCurrentCursor().device_scale_factor());
}
}
diff --git a/ash/wm/image_cursors.cc b/ash/wm/image_cursors.cc
index e63bece7ff..2a41375d19 100644
--- a/ash/wm/image_cursors.cc
+++ b/ash/wm/image_cursors.cc
@@ -6,6 +6,9 @@
#include <float.h>
+#include "ash/display/display_info.h"
+#include "ash/display/display_manager.h"
+#include "ash/shell.h"
#include "base/logging.h"
#include "base/strings/string16.h"
#include "ui/base/cursor/cursor.h"
@@ -56,41 +59,54 @@ const int kAnimatedCursorIds[] = {
ui::kCursorProgress
};
-ImageCursors::ImageCursors() : scale_(1.f), cursor_set_(ui::CURSOR_SET_NORMAL) {
+ImageCursors::ImageCursors() : cursor_set_(ui::CURSOR_SET_NORMAL) {
}
ImageCursors::~ImageCursors() {
}
-gfx::Display ImageCursors::GetDisplay() const {
+float ImageCursors::GetScale() const {
if (!cursor_loader_) {
NOTREACHED();
// Returning default on release build as it's not serious enough to crash
// even if this ever happens.
- return gfx::Display();
+ return 1.0f;
}
- return cursor_loader_->display();
+ return cursor_loader_->scale();
+}
+
+gfx::Display::Rotation ImageCursors::GetRotation() const {
+ if (!cursor_loader_) {
+ NOTREACHED();
+ // Returning default on release build as it's not serious enough to crash
+ // even if this ever happens.
+ return gfx::Display::ROTATE_0;
+ }
+ return cursor_loader_->rotation();
}
bool ImageCursors::SetDisplay(const gfx::Display& display) {
- float device_scale_factor = display.device_scale_factor();
+ DCHECK(display.is_valid());
+ // Use the platform's device scale factor instead of display's
+ // that might have been adjusted for UI scale.
+ float scale_factor = Shell::GetInstance()->display_manager()->
+ GetDisplayInfo(display.id()).device_scale_factor();
+
if (!cursor_loader_) {
cursor_loader_.reset(ui::CursorLoader::Create());
- cursor_loader_->set_scale(scale_);
- } else if (cursor_loader_->display().rotation() == display.rotation() &&
- cursor_loader_->display().device_scale_factor() ==
- device_scale_factor) {
+ } else if (cursor_loader_->rotation() == display.rotation() &&
+ cursor_loader_->scale() == scale_factor) {
return false;
}
- cursor_loader_->set_display(display);
+ cursor_loader_->set_rotation(display.rotation());
+ cursor_loader_->set_scale(scale_factor);
ReloadCursors();
return true;
}
void ImageCursors::ReloadCursors() {
- const gfx::Display& display = cursor_loader_->display();
- float device_scale_factor = display.device_scale_factor();
+ float device_scale_factor = cursor_loader_->scale();
cursor_loader_->UnloadAll();
@@ -121,20 +137,6 @@ void ImageCursors::ReloadCursors() {
}
}
-void ImageCursors::SetScale(float scale) {
- if (scale < FLT_EPSILON) {
- NOTREACHED() << "Scale must be bigger than 0.";
- scale = 1.0f;
- }
-
- scale_ = scale;
-
- if (cursor_loader_.get()) {
- cursor_loader_->set_scale(scale);
- ReloadCursors();
- }
-}
-
void ImageCursors::SetCursorSet(ui::CursorSetType cursor_set) {
if (cursor_set_ == cursor_set)
return;
diff --git a/ash/wm/image_cursors.h b/ash/wm/image_cursors.h
index 55bc34c0c4..1a75f40a9e 100644
--- a/ash/wm/image_cursors.h
+++ b/ash/wm/image_cursors.h
@@ -9,12 +9,9 @@
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "ui/base/cursor/cursor.h"
+#include "ui/gfx/display.h"
#include "ui/gfx/native_widget_types.h"
-namespace gfx {
-class Display;
-}
-
namespace ui {
class CursorLoader;
}
@@ -28,9 +25,9 @@ class ASH_EXPORT ImageCursors {
ImageCursors();
~ImageCursors();
- // Returns the display the cursors are loaded for. The display must
- // be set by SetDisplay before using this.
- gfx::Display GetDisplay() const;
+ // Returns the scale and rotation of the currently loaded cursor.
+ float GetScale() const;
+ gfx::Display::Rotation GetRotation() const;
// Sets the display the cursors are loaded for. The device scale factor
// determines the size of the image to load, and the rotation of the display
@@ -38,9 +35,6 @@ class ASH_EXPORT ImageCursors {
// Returns true if the cursor image is reloaded.
bool SetDisplay(const gfx::Display& display);
- // Sets the scale of the mouse cursor icon.
- void SetScale(float scale);
-
// Sets the type of the mouse cursor icon.
void SetCursorSet(ui::CursorSetType cursor_set);
@@ -52,7 +46,6 @@ class ASH_EXPORT ImageCursors {
void ReloadCursors();
scoped_ptr<ui::CursorLoader> cursor_loader_;
- float scale_;
ui::CursorSetType cursor_set_;
DISALLOW_COPY_AND_ASSIGN(ImageCursors);
diff --git a/ash/wm/maximize_mode/maximize_mode_controller.cc b/ash/wm/maximize_mode/maximize_mode_controller.cc
index ac018bb2f2..0b9ee53b06 100644
--- a/ash/wm/maximize_mode/maximize_mode_controller.cc
+++ b/ash/wm/maximize_mode/maximize_mode_controller.cc
@@ -31,9 +31,9 @@ const float kFullyOpenAngleErrorTolerance = 20.0f;
// the accelerometers for the base and lid approach the same values (i.e.
// gravity pointing in the direction of the hinge). When this happens we cannot
// compute the hinge angle reliably and must turn ignore accelerometer readings.
-// This is the angle from vertical under which we will not compute a hinge
-// angle.
-const float kHingeAxisAlignedThreshold = 15.0f;
+// This is the minimum acceleration perpendicular to the hinge under which to
+// detect hinge angle.
+const float kHingeAngleDetectionThreshold = 0.25f;
// The maximum deviation from the acceleration expected due to gravity under
// which to detect hinge angle and screen rotation.
@@ -115,18 +115,24 @@ void MaximizeModeController::HandleHingeRotation(const gfx::Vector3dF& base,
static const gfx::Vector3dF hinge_vector(0.0f, 1.0f, 0.0f);
bool maximize_mode_engaged =
Shell::GetInstance()->IsMaximizeModeWindowManagerEnabled();
+ // Ignore the component of acceleration parallel to the hinge for the purposes
+ // of hinge angle calculation.
+ gfx::Vector3dF base_flattened(base);
+ gfx::Vector3dF lid_flattened(lid);
+ base_flattened.set_y(0.0f);
+ lid_flattened.set_y(0.0f);
// As the hinge approaches a vertical angle, the base and lid accelerometers
// approach the same values making any angle calculations highly inaccurate.
// Bail out early when it is too close.
- float hinge_angle = AngleBetweenVectorsInDegrees(base, hinge_vector);
- if (hinge_angle < kHingeAxisAlignedThreshold ||
- hinge_angle > 180.0f - kHingeAxisAlignedThreshold) {
+ if (base_flattened.Length() < kHingeAngleDetectionThreshold ||
+ lid_flattened.Length() < kHingeAngleDetectionThreshold) {
return;
}
// Compute the angle between the base and the lid.
- float angle = ClockwiseAngleBetweenVectorsInDegrees(base, lid, hinge_vector);
+ float angle = ClockwiseAngleBetweenVectorsInDegrees(base_flattened,
+ lid_flattened, hinge_vector);
// Toggle maximize mode on or off when corresponding thresholds are passed.
// TODO(flackr): Make MaximizeModeController own the MaximizeModeWindowManager
diff --git a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
index 9f2c5d6b01..2023b3c801 100644
--- a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
+++ b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
@@ -301,6 +301,31 @@ TEST_F(MaximizeModeWindowManagerTest, CreateWindows) {
EXPECT_EQ(rect.ToString(), w8->bounds().ToString());
}
+// Test that a window which got created while the maximize mode window manager
+// is active gets restored to a usable (non tiny) size upon switching back.
+TEST_F(MaximizeModeWindowManagerTest,
+ CreateWindowInMaximizedModeRestoresToUsefulSize) {
+ ash::MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager();
+ ASSERT_TRUE(manager);
+ EXPECT_EQ(0, manager->GetNumberOfManagedWindows());
+
+ // We pass in an empty rectangle to simulate a window creation with no
+ // particular size.
+ gfx::Rect empty_rect(0, 0, 0, 0);
+ scoped_ptr<aura::Window> window(CreateWindow(ui::wm::WINDOW_TYPE_NORMAL,
+ empty_rect));
+ EXPECT_TRUE(wm::GetWindowState(window.get())->IsMaximized());
+ EXPECT_NE(empty_rect.ToString(), window->bounds().ToString());
+ gfx::Rect maximized_size = window->bounds();
+
+ // Destroy the maximize mode and check that the resulting size of the window
+ // is remaining as it is (but not maximized).
+ DestroyMaximizeModeWindowManager();
+
+ EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized());
+ EXPECT_EQ(maximized_size.ToString(), window->bounds().ToString());
+}
+
// Test that non-maximizable windows get properly handled when created in
// maximized mode.
TEST_F(MaximizeModeWindowManagerTest,
diff --git a/ash/wm/maximize_mode/workspace_backdrop_delegate.cc b/ash/wm/maximize_mode/workspace_backdrop_delegate.cc
index 0b7fc0133f..4e8a259bf7 100644
--- a/ash/wm/maximize_mode/workspace_backdrop_delegate.cc
+++ b/ash/wm/maximize_mode/workspace_backdrop_delegate.cc
@@ -37,8 +37,15 @@ WorkspaceBackdropDelegate::WorkspaceBackdropDelegate(aura::Window* container)
// activateable.
params.can_activate = false;
background_->Init(params);
+ // Do not use the animation system. We don't want the bounds animation and
+ // opacity needs to get set to |kBackdropOpacity|.
+ ::wm::SetWindowVisibilityAnimationTransition(
+ background_->GetNativeView(),
+ ::wm::ANIMATE_NONE);
background_->GetNativeView()->SetName("WorkspaceBackdropDelegate");
background_->GetNativeView()->layer()->SetColor(SK_ColorBLACK);
+ // Make sure that the layer covers visibly everything - including the shelf.
+ background_->GetNativeView()->layer()->SetBounds(params.bounds);
Show();
RestackBackdrop();
container_->AddObserver(this);
diff --git a/ash/wm/overview/OWNERS b/ash/wm/overview/OWNERS
deleted file mode 100644
index 343711b35e..0000000000
--- a/ash/wm/overview/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-flackr@chromium.org
diff --git a/ash/wm/overview/window_overview.cc b/ash/wm/overview/window_overview.cc
index 8c7af63c35..fd618b37c1 100644
--- a/ash/wm/overview/window_overview.cc
+++ b/ash/wm/overview/window_overview.cc
@@ -264,7 +264,7 @@ void WindowOverview::OnMouseEvent(ui::MouseEvent* event) {
if (!target)
return;
- event->StopPropagation();
+ event->SetHandled();
if (event->type() != ui::ET_MOUSE_RELEASED)
return;
diff --git a/ash/wm/overview/window_selector_controller.cc b/ash/wm/overview/window_selector_controller.cc
index 71b97bfb5b..b750e37739 100644
--- a/ash/wm/overview/window_selector_controller.cc
+++ b/ash/wm/overview/window_selector_controller.cc
@@ -8,6 +8,7 @@
#include "ash/root_window_controller.h"
#include "ash/session_state_delegate.h"
#include "ash/shell.h"
+#include "ash/system/tray/system_tray_delegate.h"
#include "ash/wm/mru_window_tracker.h"
#include "ash/wm/overview/window_selector.h"
#include "ash/wm/window_state.h"
@@ -26,17 +27,23 @@ WindowSelectorController::~WindowSelectorController() {
// static
bool WindowSelectorController::CanSelect() {
// Don't allow a window overview if the screen is locked or a modal dialog is
- // open.
+ // open or running in kiosk app session.
return Shell::GetInstance()->session_state_delegate()->
IsActiveUserSessionStarted() &&
!Shell::GetInstance()->session_state_delegate()->IsScreenLocked() &&
- !Shell::GetInstance()->IsSystemModalWindowOpen();
+ !Shell::GetInstance()->IsSystemModalWindowOpen() &&
+ Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus() !=
+ user::LOGGED_IN_KIOSK_APP;
}
void WindowSelectorController::ToggleOverview() {
if (IsSelecting()) {
OnSelectionCanceled();
} else {
+ // Don't start overview if window selection is not allowed.
+ if (!CanSelect())
+ return;
+
std::vector<aura::Window*> windows = ash::Shell::GetInstance()->
mru_window_tracker()->BuildMruWindowList();
// Don't enter overview mode with no windows.
diff --git a/ash/wm/overview/window_selector_item.cc b/ash/wm/overview/window_selector_item.cc
index a2c25b617e..9866185cd9 100644
--- a/ash/wm/overview/window_selector_item.cc
+++ b/ash/wm/overview/window_selector_item.cc
@@ -3,11 +3,75 @@
// found in the LICENSE file.
#include "ash/wm/overview/window_selector_item.h"
+
+#include "ash/screen_util.h"
+#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
+#include "ash/wm/overview/scoped_transform_overview_window.h"
#include "base/auto_reset.h"
+#include "third_party/skia/include/core/SkColor.h"
#include "ui/aura/window.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/compositor/scoped_layer_animation_settings.h"
+#include "ui/views/controls/label.h"
+#include "ui/views/layout/box_layout.h"
+#include "ui/views/widget/widget.h"
namespace ash {
+// Foreground label color.
+static const SkColor kLabelColor = SK_ColorWHITE;
+
+// Background label color.
+static const SkColor kLabelBackground = SK_ColorTRANSPARENT;
+
+// Label shadow color.
+static const SkColor kLabelShadow = 0xB0000000;
+
+// Vertical padding for the label, both over and beneath it.
+static const int kVerticalLabelPadding = 20;
+
+// Solid shadow length from the label
+static const int kVerticalShadowOffset = 1;
+
+// Amount of blur applied to the label shadow
+static const int kShadowBlur = 10;
+
+views::Widget* CreateWindowLabel(aura::Window* root_window,
+ const base::string16 title) {
+ views::Widget* widget = new views::Widget;
+ views::Widget::InitParams params;
+ params.type = views::Widget::InitParams::TYPE_POPUP;
+ params.can_activate = false;
+ params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
+ params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
+ params.parent =
+ Shell::GetContainer(root_window, ash::kShellWindowId_OverlayContainer);
+ params.accept_events = false;
+ params.visible_on_all_workspaces = true;
+ widget->set_focus_on_creation(false);
+ widget->Init(params);
+ views::Label* label = new views::Label;
+ label->SetEnabledColor(kLabelColor);
+ label->SetBackgroundColor(kLabelBackground);
+ label->SetShadowColors(kLabelShadow, kLabelShadow);
+ label->SetShadowOffset(0, kVerticalShadowOffset);
+ label->set_shadow_blur(kShadowBlur);
+ ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
+ label->SetFontList(bundle.GetFontList(ui::ResourceBundle::BoldFont));
+ label->SetText(title);
+ views::BoxLayout* layout = new views::BoxLayout(views::BoxLayout::kVertical,
+ 0,
+ kVerticalLabelPadding,
+ 0);
+ label->SetLayoutManager(layout);
+ widget->SetContentsView(label);
+ widget->Show();
+ return widget;
+}
+
+const int WindowSelectorItem::kFadeInMilliseconds = 80;
+
WindowSelectorItem::WindowSelectorItem()
: root_window_(NULL),
in_bounds_update_(false) {
@@ -24,6 +88,8 @@ void WindowSelectorItem::SetBounds(aura::Window* root_window,
root_window_ = root_window;
target_bounds_ = target_bounds;
SetItemBounds(root_window, target_bounds, true);
+ // TODO(nsatragno): Handle window title updates.
+ UpdateWindowLabels(target_bounds, root_window);
}
void WindowSelectorItem::RecomputeWindowTransforms() {
@@ -34,4 +100,56 @@ void WindowSelectorItem::RecomputeWindowTransforms() {
SetItemBounds(root_window_, target_bounds_, false);
}
+void WindowSelectorItem::UpdateWindowLabels(const gfx::Rect& window_bounds,
+ aura::Window* root_window) {
+ gfx::Rect converted_bounds = ScreenUtil::ConvertRectFromScreen(root_window,
+ window_bounds);
+ gfx::Rect label_bounds(converted_bounds.x(),
+ converted_bounds.bottom(),
+ converted_bounds.width(),
+ 0);
+
+ // If the root window has changed, force the window label to be recreated
+ // and faded in on the new root window.
+ if (window_label_ &&
+ window_label_->GetNativeWindow()->GetRootWindow() != root_window) {
+ window_label_.reset();
+ }
+
+ if (!window_label_) {
+ window_label_.reset(CreateWindowLabel(root_window,
+ SelectionWindow()->title()));
+ label_bounds.set_height(window_label_->
+ GetContentsView()->GetPreferredSize().height());
+ window_label_->GetNativeWindow()->SetBounds(label_bounds);
+ ui::Layer* layer = window_label_->GetNativeWindow()->layer();
+
+ layer->SetOpacity(0);
+ layer->GetAnimator()->StopAnimating();
+
+ layer->GetAnimator()->SchedulePauseForProperties(
+ base::TimeDelta::FromMilliseconds(
+ ScopedTransformOverviewWindow::kTransitionMilliseconds),
+ ui::LayerAnimationElement::OPACITY);
+
+ ui::ScopedLayerAnimationSettings settings(layer->GetAnimator());
+ settings.SetPreemptionStrategy(
+ ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
+ settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
+ kFadeInMilliseconds));
+ layer->SetOpacity(1);
+ } else {
+ ui::ScopedLayerAnimationSettings settings(
+ window_label_->GetNativeWindow()->layer()->GetAnimator());
+ settings.SetPreemptionStrategy(
+ ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
+ settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
+ ScopedTransformOverviewWindow::kTransitionMilliseconds));
+ label_bounds.set_height(window_label_->
+ GetContentsView()->GetPreferredSize().height());
+ window_label_->GetNativeWindow()->SetBounds(label_bounds);
+ }
+
+}
+
} // namespace ash
diff --git a/ash/wm/overview/window_selector_item.h b/ash/wm/overview/window_selector_item.h
index eedf3e1f91..0c69ddac80 100644
--- a/ash/wm/overview/window_selector_item.h
+++ b/ash/wm/overview/window_selector_item.h
@@ -6,12 +6,18 @@
#define ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_
#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/strings/string16.h"
#include "ui/gfx/rect.h"
namespace aura {
class Window;
}
+namespace views {
+class Widget;
+}
+
namespace ash {
// This class represents an item in overview mode. An item can have one or more
@@ -22,6 +28,10 @@ class WindowSelectorItem {
WindowSelectorItem();
virtual ~WindowSelectorItem();
+ // The time for the close buttons and labels to fade in when initially shown
+ // on entering overview mode.
+ static const int kFadeInMilliseconds;
+
// Returns the root window on which this item is shown.
virtual aura::Window* GetRootWindow() = 0;
@@ -74,7 +84,13 @@ class WindowSelectorItem {
// Sets the bounds used by the selector item's windows.
void set_bounds(const gfx::Rect& bounds) { bounds_ = bounds; }
+ // Creates a label to display under the window selector item.
+ void UpdateWindowLabels(const gfx::Rect& target_bounds,
+ aura::Window* root_window);
+
private:
+ friend class WindowSelectorTest;
+
// The root window this item is being displayed on.
aura::Window* root_window_;
@@ -90,6 +106,9 @@ class WindowSelectorItem {
// a window layer for display on another monitor.
bool in_bounds_update_;
+ // Label under the window displaying its active tab name.
+ scoped_ptr<views::Widget> window_label_;
+
DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem);
};
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc
index 20184aaaec..ce93b6976d 100644
--- a/ash/wm/overview/window_selector_unittest.cc
+++ b/ash/wm/overview/window_selector_unittest.cc
@@ -8,6 +8,7 @@
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
+#include "ash/shell_window_ids.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/shelf_test_api.h"
#include "ash/test/shelf_view_test_api.h"
@@ -16,6 +17,7 @@
#include "ash/wm/mru_window_tracker.h"
#include "ash/wm/overview/window_selector.h"
#include "ash/wm/overview/window_selector_controller.h"
+#include "ash/wm/overview/window_selector_item.h"
#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h"
#include "ash/wm/wm_event.h"
@@ -35,6 +37,8 @@
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/gfx/rect_conversions.h"
#include "ui/gfx/transform.h"
+#include "ui/views/controls/label.h"
+#include "ui/views/widget/native_widget_aura.h"
#include "ui/wm/core/window_util.h"
#include "ui/wm/public/activation_delegate.h"
@@ -225,6 +229,15 @@ class WindowSelectorTest : public test::AshTestBase {
aura::Window* GetFocusedWindow() {
return aura::client::GetFocusClient(
Shell::GetPrimaryRootWindow())->GetFocusedWindow();
+ }
+
+ ScopedVector<WindowSelectorItem>* GetWindowItems() {
+ return &(ash::Shell::GetInstance()->window_selector_controller()->
+ window_selector_->windows_);
+ }
+
+ views::Widget* GetLabelWidget(ash::WindowSelectorItem* window) {
+ return window->window_label_.get();
}
test::ShelfViewTestAPI* shelf_view_test() {
@@ -1087,4 +1100,48 @@ TEST_F(WindowSelectorTest, HitTestingInOverview) {
}
}
+// Test that a label is created under the window on entering overview mode.
+TEST_F(WindowSelectorTest, CreateLabelUnderWindow) {
+ scoped_ptr<aura::Window> window(CreateWindow(gfx::Rect(0, 0, 100, 100)));
+ base::string16 window_title = base::UTF8ToUTF16("My window");
+ window->set_title(window_title);
+ ToggleOverview();
+ WindowSelectorItem* window_item = GetWindowItems()->back();
+ views::Widget* widget = GetLabelWidget(window_item);
+ // Has the label widget been created?
+ ASSERT_TRUE(widget);
+ views::Label* label = static_cast<views::Label*>(widget->GetContentsView());
+ // Verify the label matches the window title.
+ EXPECT_EQ(label->text(), window_title);
+ // Labels are located based on target_bounds, not the actual window item
+ // bounds.
+ gfx::Rect target_bounds(window_item->target_bounds());
+ gfx::Rect expected_label_bounds(target_bounds.x(),
+ target_bounds.bottom(),
+ target_bounds.width(),
+ label->GetPreferredSize().height());
+ gfx::Rect real_label_bounds = widget->GetNativeWindow()->bounds();
+ EXPECT_EQ(widget->GetNativeWindow()->bounds(), real_label_bounds);
+}
+
+// Tests that a label is created for the active panel in a group of panels in
+// overview mode.
+TEST_F(WindowSelectorTest, CreateLabelUnderPanel) {
+ scoped_ptr<aura::Window> panel1(CreatePanelWindow(gfx::Rect(0, 0, 100, 100)));
+ scoped_ptr<aura::Window> panel2(CreatePanelWindow(gfx::Rect(0, 0, 100, 100)));
+ base::string16 panel1_title = base::UTF8ToUTF16("My panel");
+ base::string16 panel2_title = base::UTF8ToUTF16("Another panel");
+ panel1->set_title(panel1_title);
+ panel2->set_title(panel2_title);
+ wm::ActivateWindow(panel1.get());
+ ToggleOverview();
+ WindowSelectorItem* window_item = GetWindowItems()->back();
+ views::Widget* widget = GetLabelWidget(window_item);
+ // Has the label widget been created?
+ ASSERT_TRUE(widget);
+ views::Label* label = static_cast<views::Label*>(widget->GetContentsView());
+ // Verify the label matches the active window title.
+ EXPECT_EQ(label->text(), panel1_title);
+}
+
} // namespace ash
diff --git a/ash/wm/overview/window_selector_window.cc b/ash/wm/overview/window_selector_window.cc
index 942edf41ef..59d247431b 100644
--- a/ash/wm/overview/window_selector_window.cc
+++ b/ash/wm/overview/window_selector_window.cc
@@ -4,6 +4,7 @@
#include "ash/wm/overview/window_selector_window.h"
+#include "ash/screen_util.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/wm/overview/scoped_transform_overview_window.h"
@@ -46,10 +47,6 @@ views::Widget* CreateCloseWindowButton(aura::Window* root_window,
return widget;
}
-// The time for the close button to fade in when initially shown on entering
-// overview mode.
-const int kCloseButtonFadeInMilliseconds = 80;
-
} // namespace
WindowSelectorWindow::WindowSelectorWindow(aura::Window* window)
@@ -103,11 +100,14 @@ void WindowSelectorWindow::SetItemBounds(aura::Window* root_window,
bool animate) {
gfx::Rect src_rect = transform_window_.GetBoundsInScreen();
set_bounds(ScopedTransformOverviewWindow::
- ShrinkRectToFitPreservingAspectRatio(src_rect, target_bounds));
+ ShrinkRectToFitPreservingAspectRatio(src_rect, target_bounds));
transform_window_.SetTransform(root_window,
ScopedTransformOverviewWindow::GetTransformForRect(src_rect, bounds()),
animate);
- UpdateCloseButtonBounds();
+ // TODO move close button management to WindowSelectorItem, so that we can
+ // also handle panels.
+ // See http://crbug.com/352143
+ UpdateCloseButtonBounds(root_window);
}
void WindowSelectorWindow::ButtonPressed(views::Button* sender,
@@ -116,9 +116,9 @@ void WindowSelectorWindow::ButtonPressed(views::Button* sender,
transform_window_.window())->Close();
}
-void WindowSelectorWindow::UpdateCloseButtonBounds() {
- aura::Window* root_window = GetRootWindow();
- gfx::Rect align_bounds(bounds());
+void WindowSelectorWindow::UpdateCloseButtonBounds(aura::Window* root_window) {
+ gfx::Rect align_bounds(
+ ScreenUtil::ConvertRectFromScreen(root_window, bounds()));
gfx::Transform close_button_transform;
close_button_transform.Translate(align_bounds.right(), align_bounds.y());
@@ -153,7 +153,7 @@ void WindowSelectorWindow::UpdateCloseButtonBounds() {
settings.SetPreemptionStrategy(
ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
- kCloseButtonFadeInMilliseconds));
+ WindowSelectorItem::kFadeInMilliseconds));
layer->SetOpacity(1);
}
} else {
diff --git a/ash/wm/overview/window_selector_window.h b/ash/wm/overview/window_selector_window.h
index 0c6d7b84ff..3b5094adad 100644
--- a/ash/wm/overview/window_selector_window.h
+++ b/ash/wm/overview/window_selector_window.h
@@ -8,7 +8,6 @@
#include "ash/wm/overview/scoped_transform_overview_window.h"
#include "ash/wm/overview/window_selector_item.h"
#include "base/compiler_specific.h"
-#include "base/memory/scoped_ptr.h"
#include "ui/gfx/rect.h"
#include "ui/views/controls/button/button.h"
@@ -46,11 +45,10 @@ class WindowSelectorWindow : public WindowSelectorItem,
// views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
-
private:
// Creates the close button window if it does not exist and updates the bounds
// to match the window selector item.
- void UpdateCloseButtonBounds();
+ void UpdateCloseButtonBounds(aura::Window* root_window);
// The window with a scoped transform represented by this selector item.
ScopedTransformOverviewWindow transform_window_;
diff --git a/ash/wm/panels/OWNERS b/ash/wm/panels/OWNERS
index c9dc2b8e06..aa215c7d50 100644
--- a/ash/wm/panels/OWNERS
+++ b/ash/wm/panels/OWNERS
@@ -1,2 +1 @@
-flackr@chromium.org
stevenjb@chromium.org
diff --git a/ash/wm/panels/attached_panel_window_targeter.cc b/ash/wm/panels/attached_panel_window_targeter.cc
new file mode 100644
index 0000000000..4e8b8f7138
--- /dev/null
+++ b/ash/wm/panels/attached_panel_window_targeter.cc
@@ -0,0 +1,75 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/wm/panels/attached_panel_window_targeter.h"
+
+#include "ash/shelf/shelf.h"
+#include "ash/shell.h"
+#include "ash/wm/panels/panel_layout_manager.h"
+
+namespace ash {
+
+AttachedPanelWindowTargeter::AttachedPanelWindowTargeter(
+ aura::Window* container,
+ const gfx::Insets& default_mouse_extend,
+ const gfx::Insets& default_touch_extend,
+ PanelLayoutManager* panel_layout_manager)
+ : ::wm::EasyResizeWindowTargeter(container,
+ default_mouse_extend,
+ default_touch_extend),
+ panel_container_(container),
+ panel_layout_manager_(panel_layout_manager),
+ default_touch_extend_(default_touch_extend) {
+ Shell::GetInstance()->AddShellObserver(this);
+}
+
+AttachedPanelWindowTargeter::~AttachedPanelWindowTargeter() {
+ Shell::GetInstance()->RemoveShellObserver(this);
+}
+
+void AttachedPanelWindowTargeter::OnShelfCreatedForRootWindow(
+ aura::Window* root_window) {
+ UpdateTouchExtend(root_window);
+}
+
+void AttachedPanelWindowTargeter::OnShelfAlignmentChanged(
+ aura::Window* root_window) {
+ // Don't update the touch insets if the shelf has not yet been created.
+ if (!panel_layout_manager_->shelf())
+ return;
+
+ UpdateTouchExtend(root_window);
+}
+
+void AttachedPanelWindowTargeter::UpdateTouchExtend(aura::Window* root_window) {
+ // Only update the touch insets for panels if they are attached to the shelf
+ // in |root_window|.
+ if (panel_container_->GetRootWindow() != root_window)
+ return;
+
+ DCHECK(panel_layout_manager_->shelf());
+
+ gfx::Insets touch(default_touch_extend_);
+ switch (panel_layout_manager_->shelf()->alignment()) {
+ case SHELF_ALIGNMENT_BOTTOM:
+ touch = gfx::Insets(touch.top(), touch.left(), 0, touch.right());
+ break;
+ case SHELF_ALIGNMENT_LEFT:
+ touch = gfx::Insets(touch.top(), 0, touch.bottom(), touch.right());
+ break;
+ case SHELF_ALIGNMENT_RIGHT:
+ touch = gfx::Insets(touch.top(), touch.left(), touch.bottom(), 0);
+ break;
+ case SHELF_ALIGNMENT_TOP:
+ touch = gfx::Insets(0, touch.left(), touch.bottom(), touch.right());
+ break;
+ default:
+ NOTREACHED();
+ return;
+ }
+
+ set_touch_extend(touch);
+}
+
+} // namespace ash
diff --git a/ash/wm/panels/attached_panel_window_targeter.h b/ash/wm/panels/attached_panel_window_targeter.h
new file mode 100644
index 0000000000..d5e8196474
--- /dev/null
+++ b/ash/wm/panels/attached_panel_window_targeter.h
@@ -0,0 +1,43 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_WM_PANELS_ATTACHED_PANEL_WINDOW_TARGETER_H_
+#define ASH_WM_PANELS_ATTACHED_PANEL_WINDOW_TARGETER_H_
+
+#include "ash/shell_observer.h"
+#include "ui/wm/core/easy_resize_window_targeter.h"
+
+namespace ash {
+
+class PanelLayoutManager;
+
+// A window targeter installed on a panel container to disallow touch
+// hit-testing of attached panel edges that are adjacent to the shelf. This
+// makes it significantly easier to correctly target shelf buttons with touch.
+class AttachedPanelWindowTargeter : public ::wm::EasyResizeWindowTargeter,
+ public ShellObserver {
+ public:
+ AttachedPanelWindowTargeter(aura::Window* container,
+ const gfx::Insets& default_mouse_extend,
+ const gfx::Insets& default_touch_extend,
+ PanelLayoutManager* panel_layout_manager);
+ virtual ~AttachedPanelWindowTargeter();
+
+ // ShellObserver:
+ virtual void OnShelfCreatedForRootWindow(aura::Window* root_window) OVERRIDE;
+ virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE;
+
+ private:
+ void UpdateTouchExtend(aura::Window* root_window);
+
+ aura::Window* panel_container_;
+ PanelLayoutManager* panel_layout_manager_;
+ gfx::Insets default_touch_extend_;
+
+ DISALLOW_COPY_AND_ASSIGN(AttachedPanelWindowTargeter);
+};
+
+} // namespace ash
+
+#endif // ASH_WM_PANELS_ATTACHED_PANEL_WINDOW_TARGETER_H_
diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc
index 853f648681..d32eb82922 100644
--- a/ash/wm/panels/panel_layout_manager_unittest.cc
+++ b/ash/wm/panels/panel_layout_manager_unittest.cc
@@ -35,6 +35,7 @@
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/events/event_utils.h"
#include "ui/views/widget/widget.h"
namespace ash {
@@ -59,9 +60,10 @@ class PanelLayoutManagerTest : public test::AshTestBase {
return CreateTestWindowInShellWithBounds(bounds);
}
- aura::Window* CreatePanelWindow(const gfx::Rect& bounds) {
+ aura::Window* CreatePanelWindowWithDelegate(aura::WindowDelegate* delegate,
+ const gfx::Rect& bounds) {
aura::Window* window = CreateTestWindowInShellWithDelegateAndType(
- NULL, ui::wm::WINDOW_TYPE_PANEL, 0, bounds);
+ delegate, ui::wm::WINDOW_TYPE_PANEL, 0, bounds);
test::TestShelfDelegate* shelf_delegate =
test::TestShelfDelegate::instance();
shelf_delegate->AddShelfItem(window);
@@ -72,6 +74,10 @@ class PanelLayoutManagerTest : public test::AshTestBase {
return window;
}
+ aura::Window* CreatePanelWindow(const gfx::Rect& bounds) {
+ return CreatePanelWindowWithDelegate(NULL, bounds);
+ }
+
aura::Window* GetPanelContainer(aura::Window* panel) {
return Shell::GetContainer(panel->GetRootWindow(),
kShellWindowId_PanelContainer);
@@ -784,6 +790,73 @@ TEST_F(PanelLayoutManagerTest, PanelsHideAndRestoreWithShelf) {
EXPECT_TRUE(w3->IsVisible());
}
+// Verifies that touches along the attached edge of a panel do not
+// target the panel itself.
+TEST_F(PanelLayoutManagerTest, TouchHitTestPanel) {
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> w(
+ CreatePanelWindowWithDelegate(&delegate, gfx::Rect(0, 0, 200, 200)));
+ ui::EventTarget* root = w->GetRootWindow();
+ ui::EventTargeter* targeter = root->GetEventTargeter();
+
+ // Note that the constants used in the touch locations below are
+ // arbitrarily-selected small numbers which will ensure the point is
+ // within the default extended region surrounding the panel. This value
+ // is calculated as
+ // kResizeOutsideBoundsSize * kResizeOutsideBoundsScaleForTouch
+ // in src/ash/root_window_controller.cc.
+
+ // Hit test outside the right edge with a bottom-aligned shelf.
+ SetAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_BOTTOM);
+ gfx::Rect bounds(w->bounds());
+ ui::TouchEvent touch(ui::ET_TOUCH_PRESSED,
+ gfx::Point(bounds.right() + 3, bounds.y() + 2),
+ 0, ui::EventTimeForNow());
+ ui::EventTarget* target = targeter->FindTargetForEvent(root, &touch);
+ EXPECT_EQ(w.get(), target);
+
+ // Hit test outside the bottom edge with a bottom-aligned shelf.
+ touch.set_location(gfx::Point(bounds.x() + 6, bounds.bottom() + 5));
+ target = targeter->FindTargetForEvent(root, &touch);
+ EXPECT_NE(w.get(), target);
+
+ // Hit test outside the bottom edge with a right-aligned shelf.
+ SetAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_RIGHT);
+ bounds = w->bounds();
+ touch.set_location(gfx::Point(bounds.x() + 6, bounds.bottom() + 5));
+ target = targeter->FindTargetForEvent(root, &touch);
+ EXPECT_EQ(w.get(), target);
+
+ // Hit test outside the right edge with a right-aligned shelf.
+ touch.set_location(gfx::Point(bounds.right() + 3, bounds.y() + 2));
+ target = targeter->FindTargetForEvent(root, &touch);
+ EXPECT_NE(w.get(), target);
+
+ // Hit test outside the top edge with a left-aligned shelf.
+ SetAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_LEFT);
+ bounds = w->bounds();
+ touch.set_location(gfx::Point(bounds.x() + 4, bounds.y() - 6));
+ target = targeter->FindTargetForEvent(root, &touch);
+ EXPECT_EQ(w.get(), target);
+
+ // Hit test outside the left edge with a left-aligned shelf.
+ touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5));
+ target = targeter->FindTargetForEvent(root, &touch);
+ EXPECT_NE(w.get(), target);
+
+ // Hit test outside the left edge with a top-aligned shelf.
+ SetAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_TOP);
+ bounds = w->bounds();
+ touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5));
+ target = targeter->FindTargetForEvent(root, &touch);
+ EXPECT_EQ(w.get(), target);
+
+ // Hit test outside the top edge with a top-aligned shelf.
+ touch.set_location(gfx::Point(bounds.x() + 4, bounds.y() - 6));
+ target = targeter->FindTargetForEvent(root, &touch);
+ EXPECT_NE(w.get(), target);
+}
+
INSTANTIATE_TEST_CASE_P(LtrRtl, PanelLayoutManagerTextDirectionTest,
testing::Bool());
diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc
index 55f0d8c623..568ea50f61 100644
--- a/ash/wm/system_modal_container_layout_manager_unittest.cc
+++ b/ash/wm/system_modal_container_layout_manager_unittest.cc
@@ -149,8 +149,8 @@ class SystemModalContainerLayoutManagerTest : public AshTestBase {
public:
virtual void SetUp() OVERRIDE {
// Allow a virtual keyboard (and initialize it per default).
- CommandLine::ForCurrentProcess()->AppendSwitch(
- keyboard::switches::kEnableVirtualKeyboard);
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ keyboard::switches::kEnableVirtualKeyboard);
AshTestBase::SetUp();
Shell::GetPrimaryRootWindowController()->ActivateKeyboard(
keyboard::KeyboardController::GetInstance());
@@ -184,31 +184,20 @@ class SystemModalContainerLayoutManagerTest : public AshTestBase {
if (show == keyboard->keyboard_visible())
return;
- // The animation has to run in order to get the notification. Run the
- // animation and wait until its finished.
- ui::ScopedAnimationDurationScaleMode normal_duration_mode(
- ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION);
- if (show)
- keyboard->ShowAndLockKeyboard();
- else
+ if (show) {
+ keyboard->ShowKeyboard(true);
+ if (keyboard->proxy()->GetKeyboardWindow()->bounds().height() == 0) {
+ keyboard->proxy()->GetKeyboardWindow()->SetBounds(
+ keyboard::KeyboardBoundsFromWindowBounds(
+ keyboard->GetContainerWindow()->bounds(), 100));
+ }
+ } else {
keyboard->HideKeyboard(keyboard::KeyboardController::HIDE_REASON_MANUAL);
-
- WaitForWindowAnimationToBeFinished(keyboard->GetContainerWindow());
+ }
DCHECK_EQ(show, keyboard->keyboard_visible());
}
- void WaitForWindowAnimationToBeFinished(aura::Window* window) {
- DCHECK(window);
- ui::Layer* layer = window->layer();
- ui::LayerAnimatorTestController controller(layer->GetAnimator());
- gfx::AnimationContainerElement* element = layer->GetAnimator();
- while (controller.animator()->is_animating()) {
- controller.StartThreadedAnimationsIfNeeded();
- base::TimeTicks step_time = controller.animator()->last_step_time();
- element->Step(step_time + base::TimeDelta::FromMilliseconds(1000));
- }
- }
};
TEST_F(SystemModalContainerLayoutManagerTest, NonModalTransient) {
diff --git a/ash/wm/toplevel_window_event_handler.cc b/ash/wm/toplevel_window_event_handler.cc
index 8b6c9ba045..f20a13fc7d 100644
--- a/ash/wm/toplevel_window_event_handler.cc
+++ b/ash/wm/toplevel_window_event_handler.cc
@@ -476,7 +476,10 @@ void ToplevelWindowEventHandler::HandleMousePressed(
ConvertPointToParent(target, event->location()));
AttemptToStartDrag(target, location_in_parent, component,
aura::client::WINDOW_MOVE_SOURCE_MOUSE);
- event->StopPropagation();
+ // Set as handled so that other event handlers do no act upon the event
+ // but still receive it so that they receive both parts of each pressed/
+ // released pair.
+ event->SetHandled();
} else {
CompleteDrag(DRAG_COMPLETE);
}
@@ -491,12 +494,13 @@ void ToplevelWindowEventHandler::HandleMouseReleased(
CompleteDrag(event->type() == ui::ET_MOUSE_RELEASED ?
DRAG_COMPLETE : DRAG_REVERT);
// Completing the drag may result in hiding the window. If this happens
- // return true so no other handlers/observers see the event. Otherwise
- // they see the event on a hidden window.
+ // mark the event as handled so no other handlers/observers act upon the
+ // event. They should see the event on a hidden window, to determine targets
+ // of destructive actions such as hiding. They should not act upon them.
if (window_resizer_ &&
event->type() == ui::ET_MOUSE_CAPTURE_CHANGED &&
!target->IsVisible()) {
- event->StopPropagation();
+ event->SetHandled();
}
}
diff --git a/ash/wm/window_positioner.cc b/ash/wm/window_positioner.cc
index 415211e33e..55d20600b9 100644
--- a/ash/wm/window_positioner.cc
+++ b/ash/wm/window_positioner.cc
@@ -50,7 +50,7 @@ const int kWindowAutoMoveDurationMS = 125;
// WindowPositioner::SetIgnoreActivations().
static bool disable_auto_positioning = false;
-// If set to true, by default the first window in ASH will be maxmized.
+// If set to true, by default the first window in ASH will be maximized.
static bool maximize_first_window = false;
// Check if any management should be performed (with a given |window|).
@@ -219,7 +219,7 @@ aura::Window* GetReferenceWindow(const aura::Window* root_window,
window->GetRootWindow() == root_window && window->TargetVisibility() &&
wm::GetWindowState(window)->window_position_managed()) {
if (found && found != window) {
- // no need to check !signle_window because the function must have
+ // no need to check !single_window because the function must have
// been already returned in the "if (!single_window)" below.
*single_window = false;
return found;
@@ -274,7 +274,8 @@ void WindowPositioner::GetBoundsAndShowStateForNewWindow(
}
return;
}
- bool maximized = wm::GetWindowState(top_window)->IsMaximized();
+ wm::WindowState* top_window_state = wm::GetWindowState(top_window);
+ bool maximized = top_window_state->IsMaximized();
// We ignore the saved show state, but look instead for the top level
// window's show state.
if (show_state_in == ui::SHOW_STATE_DEFAULT) {
@@ -282,6 +283,23 @@ void WindowPositioner::GetBoundsAndShowStateForNewWindow(
ui::SHOW_STATE_DEFAULT;
}
+ if (maximized) {
+ bool has_restore_bounds = top_window_state->HasRestoreBounds();
+ if (has_restore_bounds) {
+ // For a maximized window ignore the real bounds of the top level window
+ // and use its restore bounds instead. Offset the bounds to prevent the
+ // windows from overlapping exactly when restored.
+ *bounds_in_out = top_window_state->GetRestoreBoundsInScreen() +
+ gfx::Vector2d(kMinimumWindowOffset, kMinimumWindowOffset);
+ }
+ if (is_saved_bounds || has_restore_bounds) {
+ gfx::Rect work_area = screen->GetDisplayNearestWindow(target).work_area();
+ bounds_in_out->AdjustToFit(work_area);
+ // Use adjusted saved bounds or restore bounds, if there is one.
+ return;
+ }
+ }
+
// Use the size of the other window. The window's bound will be rearranged
// in ash::WorkspaceLayoutManager using this location.
*bounds_in_out = top_window->GetBoundsInScreen();
@@ -419,7 +437,7 @@ gfx::Rect WindowPositioner::GetPopupPosition(const gfx::Rect& old_pos) {
popup_position_offset_from_screen_corner_x = grid;
popup_position_offset_from_screen_corner_y = grid;
if (!pop_position_offset_increment_x) {
- // When the popup position increment is , the last popup position
+ // When the popup position increment is 0, the last popup position
// was not yet initialized.
last_popup_position_x_ = popup_position_offset_from_screen_corner_x;
last_popup_position_y_ = popup_position_offset_from_screen_corner_y;
diff --git a/ash/wm/window_positioner_unittest.cc b/ash/wm/window_positioner_unittest.cc
index 49c74b4f99..1459853846 100644
--- a/ash/wm/window_positioner_unittest.cc
+++ b/ash/wm/window_positioner_unittest.cc
@@ -21,6 +21,8 @@ typedef test::AshTestBase WindowPositionerTest;
TEST_F(WindowPositionerTest, OpenMaximizedWindowOnSecondDisplay) {
if (!SupportsMultipleDisplays())
return;
+ // Tests that for a screen that is narrower than kForceMaximizeWidthLimit
+ // a new window gets maximized.
UpdateDisplay("400x400,500x500");
Shell::GetInstance()->set_target_root_window(
Shell::GetAllRootWindows()[1]);
@@ -58,6 +60,46 @@ TEST_F(WindowPositionerTest, OpenDefaultWindowOnSecondDisplay) {
second_root_window).bounds().Contains(bounds));
}
+// Tests that second window inherits first window's maximized state as well as
+// its restore bounds.
+TEST_F(WindowPositionerTest, SecondMaximizedWindowHasProperRestoreSize) {
+#if defined(OS_WIN)
+ ash::WindowPositioner::SetMaximizeFirstWindow(true);
+#endif
+ UpdateDisplay("1400x900");
+ shell::ToplevelWindow::CreateParams params;
+ params.can_resize = true;
+ params.can_maximize = true;
+ views::Widget* widget1 =
+ shell::ToplevelWindow::CreateToplevelWindow(params);
+ gfx::Rect bounds = widget1->GetWindowBoundsInScreen();
+
+#if !defined(OS_WIN)
+ // The window should have default size.
+ EXPECT_FALSE(widget1->IsMaximized());
+ EXPECT_EQ("300x300", bounds.size().ToString());
+ widget1->Maximize();
+#endif
+ // The window should be maximized.
+ bounds = widget1->GetWindowBoundsInScreen();
+ EXPECT_TRUE(widget1->IsMaximized());
+ EXPECT_EQ("0,0 1400x853", bounds.ToString());
+
+ // Create another window
+ views::Widget* widget2 =
+ shell::ToplevelWindow::CreateToplevelWindow(params);
+
+ // The second window should be maximized.
+ bounds = widget2->GetWindowBoundsInScreen();
+ EXPECT_TRUE(widget2->IsMaximized());
+ EXPECT_EQ("0,0 1400x853", bounds.ToString());
+
+ widget2->Restore();
+ // Second window's restored size should be set to default size.
+ bounds = widget2->GetWindowBoundsInScreen();
+ EXPECT_EQ("300x300", bounds.size().ToString());
+}
+
namespace {
// A WidgetDelegate that returns the out of display saved bounds.
diff --git a/ash/wm/workspace/workspace_event_handler.cc b/ash/wm/workspace/workspace_event_handler.cc
index bfc8104637..bba3f76160 100644
--- a/ash/wm/workspace/workspace_event_handler.cc
+++ b/ash/wm/workspace/workspace_event_handler.cc
@@ -15,16 +15,26 @@
namespace ash {
-WorkspaceEventHandler::WorkspaceEventHandler() {
+WorkspaceEventHandler::WorkspaceEventHandler()
+ : click_component_(HTNOWHERE) {
}
WorkspaceEventHandler::~WorkspaceEventHandler() {
}
void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) {
+ aura::Window* target = static_cast<aura::Window*>(event->target());
+ if (event->type() == ui::ET_MOUSE_PRESSED &&
+ event->IsOnlyLeftMouseButton() &&
+ ((event->flags() &
+ (ui::EF_IS_DOUBLE_CLICK | ui::EF_IS_TRIPLE_CLICK)) == 0)) {
+ click_component_ = target->delegate()->
+ GetNonClientComponent(event->location());
+ }
+
if (event->handled())
return;
- aura::Window* target = static_cast<aura::Window*>(event->target());
+
switch (event->type()) {
case ui::ET_MOUSE_MOVED: {
int component =
@@ -40,16 +50,29 @@ void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) {
break;
case ui::ET_MOUSE_PRESSED: {
wm::WindowState* target_state = wm::GetWindowState(target);
- if (event->flags() & ui::EF_IS_DOUBLE_CLICK &&
- event->IsOnlyLeftMouseButton() &&
- target->delegate()->GetNonClientComponent(event->location()) ==
- HTCAPTION) {
- ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction(
- ash::UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK);
- const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_MAXIMIZE_CAPTION);
- target_state->OnWMEvent(&wm_event);
- event->StopPropagation();
+
+ if (event->IsOnlyLeftMouseButton()) {
+ if (event->flags() & ui::EF_IS_DOUBLE_CLICK) {
+ int component = target->delegate()->
+ GetNonClientComponent(event->location());
+ if (component == HTCAPTION &&
+ component == click_component_) {
+ ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction(
+ ash::UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK);
+ const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_MAXIMIZE_CAPTION);
+ target_state->OnWMEvent(&wm_event);
+ event->StopPropagation();
+ }
+ // WindowEventHandler can receive each event up to two times. Once a
+ // double-click has been received clear the target. Otherwise a
+ // duplicate of the event will be checking target history against
+ // itself.
+ click_component_ = HTNOWHERE;
+ }
+ } else {
+ click_component_ = HTNOWHERE;
}
+
multi_window_resize_controller_.Hide();
HandleVerticalResizeDoubleClick(target_state, event);
break;
@@ -60,29 +83,36 @@ void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) {
}
void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event) {
- if (event->handled())
+ if (event->handled() || event->type() != ui::ET_GESTURE_TAP)
return;
+
aura::Window* target = static_cast<aura::Window*>(event->target());
- if (event->type() == ui::ET_GESTURE_TAP &&
- target->delegate()->GetNonClientComponent(event->location()) ==
- HTCAPTION) {
- if (event->details().tap_count() == 2) {
- ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction(
- ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE);
- // Note: TouchUMA::GESTURE_FRAMEVIEW_TAP is counted twice each time
- // TouchUMA::GESTURE_MAXIMIZE_DOUBLETAP is counted once.
- TouchUMA::GetInstance()->RecordGestureAction(
- TouchUMA::GESTURE_MAXIMIZE_DOUBLETAP);
- const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_MAXIMIZE_CAPTION);
- wm::GetWindowState(target)->OnWMEvent(&wm_event);
- event->StopPropagation();
- return;
- } else {
- // Note: TouchUMA::GESTURE_FRAMEVIEW_TAP is counted twice for each tap.
- TouchUMA::GetInstance()->RecordGestureAction(
- TouchUMA::GESTURE_FRAMEVIEW_TAP);
- }
+ int previous_target_component = click_component_;
+ click_component_ = target->delegate()->
+ GetNonClientComponent(event->location());
+
+ if (click_component_ != HTCAPTION)
+ return;
+
+ if (event->details().tap_count() != 2) {
+ // Note: TouchUMA::GESTURE_FRAMEVIEW_TAP is counted twice for each tap.
+ TouchUMA::GetInstance()->
+ RecordGestureAction(TouchUMA::GESTURE_FRAMEVIEW_TAP);
+ return;
+ }
+
+ if (click_component_ == previous_target_component) {
+ ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction(
+ ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE);
+ // Note: TouchUMA::GESTURE_FRAMEVIEW_TAP is counted twice each time
+ // TouchUMA::GESTURE_MAXIMIZE_DOUBLETAP is counted once.
+ TouchUMA::GetInstance()->RecordGestureAction(
+ TouchUMA::GESTURE_MAXIMIZE_DOUBLETAP);
+ const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_MAXIMIZE_CAPTION);
+ wm::GetWindowState(target)->OnWMEvent(&wm_event);
+ event->StopPropagation();
}
+ click_component_ = HTNOWHERE;
}
void WorkspaceEventHandler::HandleVerticalResizeDoubleClick(
diff --git a/ash/wm/workspace/workspace_event_handler.h b/ash/wm/workspace/workspace_event_handler.h
index f949821720..0610537e8c 100644
--- a/ash/wm/workspace/workspace_event_handler.h
+++ b/ash/wm/workspace/workspace_event_handler.h
@@ -36,6 +36,13 @@ class WorkspaceEventHandler : public ui::EventHandler {
MultiWindowResizeController multi_window_resize_controller_;
+ // The non-client component for the target of a MouseEvent or GestureEvent.
+ // Events can be destructive to the window tree, which can cause the
+ // component of a ui::EF_IS_DOUBLE_CLICK event to no longer be the same as
+ // that of the initial click. Acting on a double click should only occur for
+ // matching components. This will be set for left clicks, and tap events.
+ int click_component_;
+
DISALLOW_COPY_AND_ASSIGN(WorkspaceEventHandler);
};
diff --git a/ash/wm/workspace/workspace_event_handler_unittest.cc b/ash/wm/workspace/workspace_event_handler_unittest.cc
index fe9ec8c2ce..f9a1e1a313 100644
--- a/ash/wm/workspace/workspace_event_handler_unittest.cc
+++ b/ash/wm/workspace/workspace_event_handler_unittest.cc
@@ -85,8 +85,8 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickSingleAxisResizeEdge) {
// Double clicking the vertical resize edge of a window should maximize it
// vertically.
gfx::Rect restored_bounds(10, 10, 50, 50);
- aura::test::TestWindowDelegate wd;
- scoped_ptr<aura::Window> window(CreateTestWindow(&wd, restored_bounds));
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> window(CreateTestWindow(&delegate, restored_bounds));
wm::ActivateWindow(window.get());
@@ -97,7 +97,7 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickSingleAxisResizeEdge) {
window.get());
// Double-click the top resize edge.
- wd.set_window_component(HTTOP);
+ delegate.set_window_component(HTTOP);
// On X a double click actually generates a drag between each press/release.
// Explicitly trigger this path since we had bugs in dealing with it
// correctly.
@@ -126,7 +126,7 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickSingleAxisResizeEdge) {
EXPECT_FALSE(window_state->HasRestoreBounds());
// Double clicking the left resize edge should maximize horizontally.
- wd.set_window_component(HTLEFT);
+ delegate.set_window_component(HTLEFT);
generator.DoubleClickLeftButton();
bounds_in_screen = window->GetBoundsInScreen();
EXPECT_EQ(restored_bounds.y(), bounds_in_screen.y());
@@ -142,21 +142,21 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickSingleAxisResizeEdge) {
#if defined(OS_WIN)
// Multi display test does not run on Win8 bot. crbug.com/247427.
- if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ if (!SupportsMultipleDisplays())
return;
#endif
// Verify the double clicking the resize edge works on 2nd display too.
UpdateDisplay("200x200,400x300");
gfx::Rect work_area2 = ScreenUtil::GetSecondaryDisplay().work_area();
- restored_bounds.SetRect(220,20, 50, 50);
+ restored_bounds.SetRect(220, 20, 50, 50);
window->SetBoundsInScreen(restored_bounds, ScreenUtil::GetSecondaryDisplay());
aura::Window* second_root = Shell::GetAllRootWindows()[1];
EXPECT_EQ(second_root, window->GetRootWindow());
aura::test::EventGenerator generator2(second_root, window.get());
// Y-axis maximization.
- wd.set_window_component(HTTOP);
+ delegate.set_window_component(HTTOP);
generator2.PressLeftButton();
generator2.ReleaseLeftButton();
generator2.set_flags(ui::EF_IS_DOUBLE_CLICK);
@@ -176,7 +176,7 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickSingleAxisResizeEdge) {
EXPECT_EQ(restored_bounds.ToString(), window->GetBoundsInScreen().ToString());
// X-axis maximization.
- wd.set_window_component(HTLEFT);
+ delegate.set_window_component(HTLEFT);
generator2.DoubleClickLeftButton();
bounds_in_screen = window->GetBoundsInScreen();
EXPECT_EQ(restored_bounds.y(), bounds_in_screen.y());
@@ -193,8 +193,8 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickSingleAxisResizeEdge) {
// Tests the behavior when double clicking the border of a side snapped window.
TEST_F(WorkspaceEventHandlerTest, DoubleClickSingleAxisWhenSideSnapped) {
gfx::Rect restored_bounds(10, 10, 50, 50);
- aura::test::TestWindowDelegate wd;
- scoped_ptr<aura::Window> window(CreateTestWindow(&wd, restored_bounds));
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> window(CreateTestWindow(&delegate, restored_bounds));
gfx::Rect work_area_in_screen = Shell::GetScreen()->GetDisplayNearestWindow(
window.get()).work_area();
@@ -214,7 +214,7 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickSingleAxisWhenSideSnapped) {
// to the restored bounds would be weird).
aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
window.get());
- wd.set_window_component(HTTOP);
+ delegate.set_window_component(HTTOP);
generator.DoubleClickLeftButton();
EXPECT_EQ(wm::WINDOW_STATE_TYPE_LEFT_SNAPPED, window_state->GetStateType());
EXPECT_EQ(snapped_bounds_in_screen.ToString(),
@@ -222,7 +222,7 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickSingleAxisWhenSideSnapped) {
// Double clicking the right border should exit the side snapped state and
// make the window take up the entire work area.
- wd.set_window_component(HTRIGHT);
+ delegate.set_window_component(HTRIGHT);
generator.DoubleClickLeftButton();
EXPECT_TRUE(window_state->IsNormalStateType());
EXPECT_EQ(work_area_in_screen.ToString(),
@@ -232,20 +232,20 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickSingleAxisWhenSideSnapped) {
TEST_F(WorkspaceEventHandlerTest,
DoubleClickSingleAxisDoesntResizeVerticalEdgeIfConstrained) {
gfx::Rect restored_bounds(10, 10, 50, 50);
- aura::test::TestWindowDelegate wd;
- scoped_ptr<aura::Window> window(CreateTestWindow(&wd, restored_bounds));
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> window(CreateTestWindow(&delegate, restored_bounds));
wm::ActivateWindow(window.get());
gfx::Rect work_area = Shell::GetScreen()->GetDisplayNearestWindow(
window.get()).work_area();
- wd.set_maximum_size(gfx::Size(0, 100));
+ delegate.set_maximum_size(gfx::Size(0, 100));
aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
window.get());
// Double-click the top resize edge.
- wd.set_window_component(HTTOP);
+ delegate.set_window_component(HTTOP);
generator.DoubleClickLeftButton();
// The size of the window should be unchanged.
@@ -256,20 +256,20 @@ TEST_F(WorkspaceEventHandlerTest,
TEST_F(WorkspaceEventHandlerTest,
DoubleClickSingleAxisDoesntResizeHorizontalEdgeIfConstrained) {
gfx::Rect restored_bounds(10, 10, 50, 50);
- aura::test::TestWindowDelegate wd;
- scoped_ptr<aura::Window> window(CreateTestWindow(&wd, restored_bounds));
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> window(CreateTestWindow(&delegate, restored_bounds));
wm::ActivateWindow(window.get());
gfx::Rect work_area = Shell::GetScreen()->GetDisplayNearestWindow(
window.get()).work_area();
- wd.set_maximum_size(gfx::Size(100, 0));
+ delegate.set_maximum_size(gfx::Size(100, 0));
aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
window.get());
// Double-click the top resize edge.
- wd.set_window_component(HTRIGHT);
+ delegate.set_window_component(HTRIGHT);
generator.DoubleClickLeftButton();
// The size of the window should be unchanged.
@@ -279,14 +279,14 @@ TEST_F(WorkspaceEventHandlerTest,
TEST_F(WorkspaceEventHandlerTest,
DoubleClickOrTapWithModalChildDoesntMaximize) {
- aura::test::TestWindowDelegate wd1;
- aura::test::TestWindowDelegate wd2;
+ aura::test::TestWindowDelegate delegate1;
+ aura::test::TestWindowDelegate delegate2;
scoped_ptr<aura::Window> window(
- CreateTestWindow(&wd1, gfx::Rect(10, 20, 30, 40)));
+ CreateTestWindow(&delegate1, gfx::Rect(10, 20, 30, 40)));
scoped_ptr<aura::Window> child(
- CreateTestWindow(&wd2, gfx::Rect(0, 0, 1, 1)));
+ CreateTestWindow(&delegate2, gfx::Rect(0, 0, 1, 1)));
window->SetProperty(aura::client::kCanMaximizeKey, true);
- wd1.set_window_component(HTCAPTION);
+ delegate1.set_window_component(HTCAPTION);
child->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW);
::wm::AddTransientChild(window.get(), child.get());
@@ -308,9 +308,9 @@ TEST_F(WorkspaceEventHandlerTest,
// Test the behavior as a result of double clicking the window header.
TEST_F(WorkspaceEventHandlerTest, DoubleClickCaptionTogglesMaximize) {
- aura::test::TestWindowDelegate wd;
+ aura::test::TestWindowDelegate delegate;
scoped_ptr<aura::Window> window(
- CreateTestWindow(&wd, gfx::Rect(1, 2, 30, 40)));
+ CreateTestWindow(&delegate, gfx::Rect(1, 2, 30, 40)));
window->SetProperty(aura::client::kCanMaximizeKey, true);
wm::WindowState* window_state = wm::GetWindowState(window.get());
@@ -321,19 +321,22 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickCaptionTogglesMaximize) {
EXPECT_FALSE(window_state->IsMaximized());
// 1) Double clicking a normal window should maximize.
- wd.set_window_component(HTCAPTION);
+ delegate.set_window_component(HTCAPTION);
aura::Window* root = Shell::GetPrimaryRootWindow();
aura::test::EventGenerator generator(root, window.get());
+ generator.ClickLeftButton();
generator.DoubleClickLeftButton();
EXPECT_NE(restore_bounds.ToString(), window->bounds().ToString());
EXPECT_TRUE(window_state->IsMaximized());
+ generator.ClickLeftButton();
generator.DoubleClickLeftButton();
EXPECT_TRUE(window_state->IsNormalStateType());
EXPECT_EQ(restore_bounds.ToString(), window->bounds().ToString());
// 2) Double clicking a horizontally maximized window should maximize.
- wd.set_window_component(HTLEFT);
+ delegate.set_window_component(HTLEFT);
+ generator.ClickLeftButton();
generator.DoubleClickLeftButton();
EXPECT_TRUE(window_state->IsNormalStateType());
EXPECT_EQ(work_area_in_parent.x(), window->bounds().x());
@@ -341,10 +344,12 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickCaptionTogglesMaximize) {
EXPECT_EQ(work_area_in_parent.width(), window->bounds().width());
EXPECT_EQ(restore_bounds.height(), window->bounds().height());
- wd.set_window_component(HTCAPTION);
+ delegate.set_window_component(HTCAPTION);
+ generator.ClickLeftButton();
generator.DoubleClickLeftButton();
EXPECT_TRUE(window_state->IsMaximized());
+ generator.ClickLeftButton();
generator.DoubleClickLeftButton();
EXPECT_TRUE(window_state->IsNormalStateType());
EXPECT_EQ(restore_bounds.ToString(), window->bounds().ToString());
@@ -354,9 +359,11 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickCaptionTogglesMaximize) {
window_state->OnWMEvent(&snap_event);
EXPECT_TRUE(window_state->IsSnapped());
generator.MoveMouseTo(window->GetBoundsInRootWindow().CenterPoint());
+ generator.ClickLeftButton();
generator.DoubleClickLeftButton();
EXPECT_TRUE(window_state->IsMaximized());
+ generator.ClickLeftButton();
generator.DoubleClickLeftButton();
EXPECT_TRUE(window_state->IsNormalStateType());
EXPECT_EQ(restore_bounds.ToString(), window->bounds().ToString());
@@ -366,11 +373,11 @@ TEST_F(WorkspaceEventHandlerTest, DoubleClickCaptionTogglesMaximize) {
// toggle the maximized state.
TEST_F(WorkspaceEventHandlerTest,
DoubleClickMiddleButtonDoesNotToggleMaximize) {
- aura::test::TestWindowDelegate wd;
+ aura::test::TestWindowDelegate delegate;
scoped_ptr<aura::Window> window(
- CreateTestWindow(&wd, gfx::Rect(1, 2, 30, 40)));
+ CreateTestWindow(&delegate, gfx::Rect(1, 2, 30, 40)));
window->SetProperty(aura::client::kCanMaximizeKey, true);
- wd.set_window_component(HTCAPTION);
+ delegate.set_window_component(HTCAPTION);
aura::Window* root = Shell::GetPrimaryRootWindow();
aura::test::EventGenerator generator(root, window.get());
@@ -395,11 +402,11 @@ TEST_F(WorkspaceEventHandlerTest,
}
TEST_F(WorkspaceEventHandlerTest, DoubleTapCaptionTogglesMaximize) {
- aura::test::TestWindowDelegate wd;
+ aura::test::TestWindowDelegate delegate;
gfx::Rect bounds(10, 20, 30, 40);
- scoped_ptr<aura::Window> window(CreateTestWindow(&wd, bounds));
+ scoped_ptr<aura::Window> window(CreateTestWindow(&delegate, bounds));
window->SetProperty(aura::client::kCanMaximizeKey, true);
- wd.set_window_component(HTCAPTION);
+ delegate.set_window_component(HTCAPTION);
wm::WindowState* window_state = wm::GetWindowState(window.get());
EXPECT_FALSE(window_state->IsMaximized());
@@ -422,14 +429,14 @@ TEST_F(WorkspaceEventHandlerTest, DoubleTapCaptionTogglesMaximize) {
TEST_F(WorkspaceEventHandlerTest, DeleteWhenDragging) {
// Create a large window in the background. This is necessary so that when we
// delete |window| WorkspaceEventHandler is still the active event handler.
- aura::test::TestWindowDelegate wd2;
+ aura::test::TestWindowDelegate delegate2;
scoped_ptr<aura::Window> window2(
- CreateTestWindow(&wd2, gfx::Rect(0, 0, 500, 500)));
+ CreateTestWindow(&delegate2, gfx::Rect(0, 0, 500, 500)));
- aura::test::TestWindowDelegate wd;
+ aura::test::TestWindowDelegate delegate;
const gfx::Rect bounds(10, 20, 30, 40);
- scoped_ptr<aura::Window> window(CreateTestWindow(&wd, bounds));
- wd.set_window_component(HTCAPTION);
+ scoped_ptr<aura::Window> window(CreateTestWindow(&delegate, bounds));
+ delegate.set_window_component(HTCAPTION);
aura::test::EventGenerator generator(window->GetRootWindow());
generator.MoveMouseToCenterOf(window.get());
generator.PressLeftButton();
@@ -441,10 +448,10 @@ TEST_F(WorkspaceEventHandlerTest, DeleteWhenDragging) {
// Verifies deleting the window while in a run loop doesn't crash.
TEST_F(WorkspaceEventHandlerTest, DeleteWhileInRunLoop) {
- aura::test::TestWindowDelegate wd;
+ aura::test::TestWindowDelegate delegate;
const gfx::Rect bounds(10, 20, 30, 40);
- scoped_ptr<aura::Window> window(CreateTestWindow(&wd, bounds));
- wd.set_window_component(HTCAPTION);
+ scoped_ptr<aura::Window> window(CreateTestWindow(&delegate, bounds));
+ delegate.set_window_component(HTCAPTION);
ASSERT_TRUE(aura::client::GetWindowMoveClient(window->GetRootWindow()));
base::MessageLoop::current()->DeleteSoon(FROM_HERE, window.get());
@@ -454,4 +461,91 @@ TEST_F(WorkspaceEventHandlerTest, DeleteWhileInRunLoop) {
aura::client::WINDOW_MOVE_SOURCE_MOUSE);
}
+// Verifies that double clicking in the header does not maximize if the target
+// component has changed.
+TEST_F(WorkspaceEventHandlerTest,
+ DoubleClickTwoDifferentTargetsDoesntMaximize) {
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> window(
+ CreateTestWindow(&delegate, gfx::Rect(1, 2, 30, 40)));
+ window->SetProperty(aura::client::kCanMaximizeKey, true);
+
+ wm::WindowState* window_state = wm::GetWindowState(window.get());
+ gfx::Rect restore_bounds = window->bounds();
+ gfx::Rect work_area_in_parent = ScreenUtil::GetDisplayWorkAreaBoundsInParent(
+ window.get());
+
+ EXPECT_FALSE(window_state->IsMaximized());
+
+ // First click will go to a client
+ delegate.set_window_component(HTCLIENT);
+ aura::Window* root = Shell::GetPrimaryRootWindow();
+ aura::test::EventGenerator generator(root, window.get());
+ generator.ClickLeftButton();
+ EXPECT_FALSE(window_state->IsMaximized());
+
+ // Second click will go to the header
+ delegate.set_window_component(HTCAPTION);
+ generator.DoubleClickLeftButton();
+ EXPECT_FALSE(window_state->IsMaximized());
+}
+
+// Verifies that double tapping in the header does not maximize if the target
+// component has changed.
+TEST_F(WorkspaceEventHandlerTest, DoubleTapTwoDifferentTargetsDoesntMaximize) {
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> window(
+ CreateTestWindow(&delegate, gfx::Rect(1, 2, 30, 40)));
+ window->SetProperty(aura::client::kCanMaximizeKey, true);
+
+ wm::WindowState* window_state = wm::GetWindowState(window.get());
+ gfx::Rect restore_bounds = window->bounds();
+ gfx::Rect work_area_in_parent = ScreenUtil::GetDisplayWorkAreaBoundsInParent(
+ window.get());
+
+ EXPECT_FALSE(window_state->IsMaximized());
+
+ // First tap will go to a client
+ delegate.set_window_component(HTCLIENT);
+ aura::Window* root = Shell::GetPrimaryRootWindow();
+ aura::test::EventGenerator generator(root, window.get());
+ generator.GestureTapAt(gfx::Point(25, 25));
+ EXPECT_FALSE(window_state->IsMaximized());
+
+ // Second tap will go to the header
+ delegate.set_window_component(HTCAPTION);
+ generator.GestureTapAt(gfx::Point(25, 25));
+ EXPECT_FALSE(window_state->IsMaximized());
+}
+
+TEST_F(WorkspaceEventHandlerTest,
+ RightClickDuringDoubleClickDoesntMaximize) {
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> window(
+ CreateTestWindow(&delegate, gfx::Rect(1, 2, 30, 40)));
+ window->SetProperty(aura::client::kCanMaximizeKey, true);
+
+ wm::WindowState* window_state = wm::GetWindowState(window.get());
+ gfx::Rect restore_bounds = window->bounds();
+ gfx::Rect work_area_in_parent = ScreenUtil::GetDisplayWorkAreaBoundsInParent(
+ window.get());
+
+ EXPECT_FALSE(window_state->IsMaximized());
+
+ // First click will go to a client
+ delegate.set_window_component(HTCLIENT);
+ aura::Window* root = Shell::GetPrimaryRootWindow();
+ aura::test::EventGenerator generator(root, window.get());
+ generator.ClickLeftButton();
+ EXPECT_FALSE(window_state->IsMaximized());
+
+ // Second click will go to the header
+ delegate.set_window_component(HTCAPTION);
+ generator.PressRightButton();
+ generator.ReleaseRightButton();
+ EXPECT_FALSE(window_state->IsMaximized());
+ generator.DoubleClickLeftButton();
+ EXPECT_FALSE(window_state->IsMaximized());
+}
+
} // namespace ash
diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc
index 6056a2f859..a2556cf497 100644
--- a/ash/wm/workspace_controller_unittest.cc
+++ b/ash/wm/workspace_controller_unittest.cc
@@ -1461,8 +1461,8 @@ TEST_F(WorkspaceControllerTest, WindowEdgeHitTest) {
}
}
-// Verifies events targeting just outside the window edges for panels.
-TEST_F(WorkspaceControllerTest, WindowEdgeHitTestPanel) {
+// Verifies mouse event targeting just outside the window edges for panels.
+TEST_F(WorkspaceControllerTest, WindowEdgeMouseHitTestPanel) {
aura::test::TestWindowDelegate delegate;
scoped_ptr<Window> window(CreateTestPanel(&delegate,
gfx::Rect(20, 10, 100, 50)));
@@ -1491,10 +1491,38 @@ TEST_F(WorkspaceControllerTest, WindowEdgeHitTestPanel) {
EXPECT_EQ(window.get(), target);
else
EXPECT_NE(window.get(), target);
+ }
+}
+// Verifies touch event targeting just outside the window edges for panels.
+// The shelf is aligned to the bottom by default, and so touches just below
+// the bottom edge of the panel should not target the panel itself because
+// an AttachedPanelWindowTargeter is installed on the panel container.
+TEST_F(WorkspaceControllerTest, WindowEdgeTouchHitTestPanel) {
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<Window> window(CreateTestPanel(&delegate,
+ gfx::Rect(20, 10, 100, 50)));
+ ui::EventTarget* root = window->GetRootWindow();
+ ui::EventTargeter* targeter = root->GetEventTargeter();
+ const gfx::Rect bounds = window->bounds();
+ const int kNumPoints = 5;
+ struct {
+ const char* direction;
+ gfx::Point location;
+ bool is_target_hit;
+ } points[kNumPoints] = {
+ { "left", gfx::Point(bounds.x() - 2, bounds.y() + 10), true },
+ { "top", gfx::Point(bounds.x() + 10, bounds.y() - 2), true },
+ { "right", gfx::Point(bounds.right() + 2, bounds.y() + 10), true },
+ { "bottom", gfx::Point(bounds.x() + 10, bounds.bottom() + 2), false },
+ { "outside", gfx::Point(bounds.x() + 10, bounds.y() - 31), false },
+ };
+ for (int i = 0; i < kNumPoints; ++i) {
+ SCOPED_TRACE(points[i].direction);
+ const gfx::Point& location = points[i].location;
ui::TouchEvent touch(ui::ET_TOUCH_PRESSED, location, 0,
ui::EventTimeForNow());
- target = targeter->FindTargetForEvent(root, &touch);
+ ui::EventTarget* target = targeter->FindTargetForEvent(root, &touch);
if (points[i].is_target_hit)
EXPECT_EQ(window.get(), target);
else