mash: Move shelf prefs from Chrome to Ash

Desktop / Chromium - Michael Wasserman [chromium.org] - 8 August 2017 19:49 EDT

Move some of Chrome's shelf pref names to ash_pref_names. Move some shelf pref code to ash/public/cpp (used by Ash and Chrome). Remove now unused mojo interface functions and enum types.

Make context menus modify prefs instead of setting values directly. (this is really the only code that should set the shelf pref values)

Add SessionController::is_running_in_app_mode and Chrome init. (Ash needs to hide the shelf in Chrome's kiosk/app modes)

Move Shelf's WindowTreeHostManager::Observer code to ShelfController. (use one observer, not per-display observers; share SetShelf*FromPrefs) Construct ShelfController in Shell::Init() to support Shell::Get() use. Init/update prefs & PrefRegistar in OnActiveUserPrefServiceChanged. Minor refactoring; add some basic unit tests.

Bug: 723085 Test: No Chrome OS shelf alignment/auto-hide regressions. Change-Id: I109ee314093fac10402b50629a95171d88e2e26f TBR: bartfab@chromium.org Reviewed-on: https://chromium-review.googlesource.com/602737 Commit-Queue: Michael Wasserman

39e4fe4 mash: Move shelf prefs from Chrome to Ash.
ash/BUILD.gn | 2 +
ash/DEPS | 1 +
ash/public/cpp/BUILD.gn | 4 +
ash/public/cpp/DEPS | 2 +
ash/public/cpp/ash_pref_names.cc | 19 ++
ash/public/cpp/ash_pref_names.h | 6 +
ash/public/cpp/shelf_prefs.cc | 229 ++++++++++++++++++++
ash/public/cpp/shelf_prefs.h | 48 +++++
ash/public/cpp/shelf_struct_traits.h | 73 -------
ash/public/interfaces/session_controller.mojom | 4 +
ash/public/interfaces/shelf.mojom | 18 --
ash/root_window_controller.cc | 1 -
ash/session/session_controller.cc | 5 +
ash/session/session_controller.h | 4 +
ash/session/session_controller_unittest.cc | 10 +
ash/shelf/shelf.cc | 30 +--
ash/shelf/shelf.h | 14 +-
ash/shelf/shelf_alignment_menu.cc | 16 +-
ash/shelf/shelf_controller.cc | 162 +++++++++-----
ash/shelf/shelf_controller.h | 35 +++-
ash/shelf/shelf_controller_unittest.cc | 215 ++++++++++++++-----
ash/shelf/shelf_unittest.cc | 105 +---------
ash/shell.cc | 4 +-
.../configuration_policy_handler_list_factory.cc | 3 +-
chrome/browser/ui/ash/chrome_launcher_prefs.cc | 233 +--------------------
chrome/browser/ui/ash/chrome_launcher_prefs.h | 23 --
.../ui/ash/launcher/chrome_launcher_controller.cc | 111 +---------
.../ui/ash/launcher/chrome_launcher_controller.h | 19 --
.../chrome_launcher_controller_browsertest.cc | 1 +
.../chrome_launcher_controller_unittest.cc | 94 ---------
.../ui/ash/launcher/launcher_context_menu.cc | 37 ++--
.../ash/launcher/launcher_context_menu_unittest.cc | 15 +-
chrome/browser/ui/ash/session_controller_client.cc | 2 +
chrome/common/pref_names.cc | 18 --
chrome/common/pref_names.h | 6 -
35 files changed, 699 insertions(+), 870 deletions(-)

Upstream: git.chromium.org


  • Share