Commit f974c6e9 authored by Mike Wasserman's avatar Mike Wasserman Committed by Commit Bot

Update ShelfWindowWatcher Mash conditionals

Bug: 722496
Change-Id: I797582085ebaf0c3f63b0eb4ec60d605342c5129
Reviewed-on: https://chromium-review.googlesource.com/1183584Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Commit-Queue: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584923}
parent 361edc1d
......@@ -7,7 +7,6 @@
#include <memory>
#include <utility>
#include "ash/public/cpp/config.h"
#include "ash/public/cpp/shelf_model.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/public/cpp/window_properties.h"
......@@ -20,6 +19,7 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_features.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/wm/public/activation_client.h"
......@@ -30,7 +30,7 @@ namespace {
// Mash returns the dialog type for normal windows without shelf item types.
// TODO(msw): Extend this Mash behavior to all Ash configs.
ShelfItemType GetShelfItemType(aura::Window* window) {
if (Shell::GetAshConfig() == Config::MASH_DEPRECATED &&
if ((features::IsMultiProcessMash() || features::IsSingleProcessMash()) &&
window->GetProperty(kShelfItemTypeKey) == TYPE_UNDEFINED &&
window->type() == aura::client::WINDOW_TYPE_NORMAL &&
!wm::GetWindowState(window)->ignored_by_shelf()) {
......@@ -43,7 +43,7 @@ ShelfItemType GetShelfItemType(aura::Window* window) {
// Mash sets and returns an initial default shelf id for unidentified windows.
// TODO(msw): Extend this Mash behavior to all Ash configs.
ShelfID GetShelfID(aura::Window* window) {
if (Shell::GetAshConfig() == Config::MASH_DEPRECATED &&
if ((features::IsMultiProcessMash() || features::IsSingleProcessMash()) &&
!window->GetProperty(kShelfIDKey) &&
!wm::GetWindowState(window)->ignored_by_shelf()) {
static int id = 0;
......@@ -118,7 +118,8 @@ void ShelfWindowWatcher::UserWindowObserver::OnWindowPropertyChanged(
intptr_t old) {
// ShelfIDs should never change except when replacing Mash temporary defaults.
// TODO(msw): Extend this Mash behavior to all Ash configs.
if (Shell::GetAshConfig() == Config::MASH_DEPRECATED && key == kShelfIDKey &&
if ((features::IsMultiProcessMash() || features::IsSingleProcessMash()) &&
key == kShelfIDKey &&
window_watcher_->user_windows_with_items_.count(window) > 0) {
ShelfID old_id = ShelfID::Deserialize(reinterpret_cast<std::string*>(old));
ShelfID new_id = ShelfID::Deserialize(window->GetProperty(kShelfIDKey));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment