Commit ff6c5235 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Mash cleanup: Remove some more window and window frame related code.

TBR=tsepez@chromium.org

Bug: 958154
Change-Id: I21dadda1bd78fbd713eb3574edea7f2087100762
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1595982
Commit-Queue: Evan Stade <estade@chromium.org>
Auto-Submit: Evan Stade <estade@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657429}
parent b66c03bc
...@@ -66,9 +66,7 @@ void UpdateShelfItemForWindow(ShelfItem* item, aura::Window* window) { ...@@ -66,9 +66,7 @@ void UpdateShelfItemForWindow(ShelfItem* item, aura::Window* window) {
} }
// Prefer app icons over window icons, they're typically larger. // Prefer app icons over window icons, they're typically larger.
gfx::ImageSkia* image = window->GetProperty(aura::client::kAppIconLargeKey); gfx::ImageSkia* image = window->GetProperty(aura::client::kAppIconKey);
if (!image || image->isNull())
image = window->GetProperty(aura::client::kAppIconKey);
if (!image || image->isNull()) if (!image || image->isNull())
image = window->GetProperty(aura::client::kWindowIconKey); image = window->GetProperty(aura::client::kWindowIconKey);
if (!image || image->isNull()) { if (!image || image->isNull()) {
...@@ -137,8 +135,7 @@ void ShelfWindowWatcher::UserWindowObserver::OnWindowPropertyChanged( ...@@ -137,8 +135,7 @@ void ShelfWindowWatcher::UserWindowObserver::OnWindowPropertyChanged(
ShelfID::Deserialize(window->GetProperty(kShelfIDKey))); ShelfID::Deserialize(window->GetProperty(kShelfIDKey)));
} }
if (key == aura::client::kAppIconLargeKey || if (key == aura::client::kAppIconKey || key == aura::client::kWindowIconKey ||
key == aura::client::kAppIconKey || key == aura::client::kWindowIconKey ||
key == aura::client::kDrawAttentionKey || key == kShelfItemTypeKey || key == aura::client::kDrawAttentionKey || key == kShelfItemTypeKey ||
key == kShelfIDKey) { key == kShelfIDKey) {
window_watcher_->OnUserWindowPropertyChanged(window); window_watcher_->OnUserWindowPropertyChanged(window);
......
...@@ -114,11 +114,8 @@ CaptionContainerView::CaptionContainerView(EventDelegate* event_delegate, ...@@ -114,11 +114,8 @@ CaptionContainerView::CaptionContainerView(EventDelegate* event_delegate,
kHorizontalLabelPaddingDp)); kHorizontalLabelPaddingDp));
AddChildWithLayer(this, header_view_); AddChildWithLayer(this, header_view_);
// Prefer kAppIconSmallKey (set by the client in Mash), then kAppIconKey and // Prefer kAppIconKey over kWindowIconKey as the app icon is typically larger.
// kWindowIconKey (set for client windows in classic Ash but not Mash). gfx::ImageSkia* icon = window->GetProperty(aura::client::kAppIconKey);
gfx::ImageSkia* icon = window->GetProperty(aura::client::kAppIconSmallKey);
if (!icon || icon->size().IsEmpty())
icon = window->GetProperty(aura::client::kAppIconKey);
if (!icon || icon->size().IsEmpty()) if (!icon || icon->size().IsEmpty())
icon = window->GetProperty(aura::client::kWindowIconKey); icon = window->GetProperty(aura::client::kWindowIconKey);
if (icon && !icon->size().IsEmpty()) { if (icon && !icon->size().IsEmpty()) {
......
...@@ -78,13 +78,12 @@ views::NativeWidget* ChromeViewsDelegate::CreateNativeWidget( ...@@ -78,13 +78,12 @@ views::NativeWidget* ChromeViewsDelegate::CreateNativeWidget(
if (params->context) if (params->context)
params->context = params->context->GetRootWindow(); params->context = params->context->GetRootWindow();
// Classic ash requires a parent or a context that it can use to look up a // Ash requires a parent or a context that it can use to look up a root window
// root window to find a WindowParentingClient. Mash handles window parenting // to find a WindowParentingClient.
// inside ash, see ash::CreateAndParentTopLevelWindow(). if (!params->parent && !params->context)
if (!features::IsUsingWindowService() && !params->parent && !params->context)
params->context = ash::Shell::GetRootWindowForNewWindows(); params->context = ash::Shell::GetRootWindowForNewWindows();
// By returning null Widget creates the default NativeWidget implementation, // By returning null Widget creates the default NativeWidget implementation,
// which for chromeos is NativeWidgetAura. // which for Chrome OS is NativeWidgetAura.
return nullptr; return nullptr;
} }
...@@ -173,7 +173,6 @@ ...@@ -173,7 +173,6 @@
#include "chrome/browser/ui/ash/window_properties.h" #include "chrome/browser/ui/ash/window_properties.h"
#include "chrome/browser/ui/views/frame/top_controls_slide_controller_chromeos.h" #include "chrome/browser/ui/views/frame/top_controls_slide_controller_chromeos.h"
#include "chrome/grit/chrome_unscaled_resources.h" #include "chrome/grit/chrome_unscaled_resources.h"
#include "ui/base/ui_base_features.h"
#else #else
#include "chrome/browser/ui/signin_view_controller.h" #include "chrome/browser/ui/signin_view_controller.h"
#endif // !defined(OS_CHROMEOS) #endif // !defined(OS_CHROMEOS)
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "ui/aura/mus/window_tree_host_mus.h" #include "ui/aura/mus/window_tree_host_mus.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/aura/window_targeter.h" #include "ui/aura/window_targeter.h"
#include "ui/base/ui_base_features.h"
#include "ui/compositor/layer.h" #include "ui/compositor/layer.h"
#include "ui/compositor/paint_context.h" #include "ui/compositor/paint_context.h"
#include "ui/compositor/paint_recorder.h" #include "ui/compositor/paint_recorder.h"
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "services/service_manager/public/cpp/connector.h" #include "services/service_manager/public/cpp/connector.h"
#include "ui/aura/client/aura_constants.h" #include "ui/aura/client/aura_constants.h"
#include "ui/aura/test/mus/change_completion_waiter.h" #include "ui/aura/test/mus/change_completion_waiter.h"
#include "ui/base/ui_base_features.h"
#include "ui/views/animation/test/ink_drop_host_view_test_api.h" #include "ui/views/animation/test/ink_drop_host_view_test_api.h"
#include "ui/views/window/frame_caption_button.h" #include "ui/views/window/frame_caption_button.h"
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "services/service_manager/public/cpp/connector.h" #include "services/service_manager/public/cpp/connector.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h" #include "ui/aura/window_tree_host.h"
#include "ui/base/ui_base_features.h"
#include "ui/display/display.h" #include "ui/display/display.h"
#include "ui/events/test/event_generator.h" #include "ui/events/test/event_generator.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
...@@ -891,11 +890,8 @@ IN_PROC_BROWSER_TEST_F(TopControlsSlideControllerTest, TestDropDowns) { ...@@ -891,11 +890,8 @@ IN_PROC_BROWSER_TEST_F(TopControlsSlideControllerTest, TestDropDowns) {
OpenUrlAtIndex(embedded_test_server()->GetURL("/top_controls_scroll.html"), OpenUrlAtIndex(embedded_test_server()->GetURL("/top_controls_scroll.html"),
0); 0);
// On mash, use nullptr root windows to route events over mojo to ash.
aura::Window* browser_window = browser()->window()->GetNativeWindow(); aura::Window* browser_window = browser()->window()->GetNativeWindow();
ui::test::EventGenerator event_generator( ui::test::EventGenerator event_generator(browser_window->GetRootWindow());
features::IsUsingWindowService() ? nullptr
: browser_window->GetRootWindow());
// Send a mouse click event that should open the popup drop-down menu of the // Send a mouse click event that should open the popup drop-down menu of the
// <select> html element on the page. // <select> html element on the page.
......
...@@ -38,9 +38,8 @@ ...@@ -38,9 +38,8 @@
#include "ash/public/cpp/shelf_item.h" #include "ash/public/cpp/shelf_item.h"
#include "ash/public/cpp/window_properties.h" #include "ash/public/cpp/window_properties.h"
#include "chrome/grit/theme_resources.h" #include "chrome/grit/theme_resources.h"
#include "ui/aura/client/aura_constants.h" #include "ui/aura/window.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_features.h"
#include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia.h"
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
...@@ -104,16 +103,6 @@ task_manager::TaskManagerTableModel* TaskManagerView::Show(Browser* browser) { ...@@ -104,16 +103,6 @@ task_manager::TaskManagerTableModel* TaskManagerView::Show(Browser* browser) {
const ash::ShelfID shelf_id(kTaskManagerId); const ash::ShelfID shelf_id(kTaskManagerId);
window->SetProperty(ash::kShelfIDKey, new std::string(shelf_id.Serialize())); window->SetProperty(ash::kShelfIDKey, new std::string(shelf_id.Serialize()));
window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_DIALOG); window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_DIALOG);
// For classic Ash, GetWindowIcon() is sufficient. For Mash, the task manager
// specifically needs to set a large app icon for the benefit of
// ShelfWindowWatcher.
if (features::IsUsingWindowService()) {
window->GetRootWindow()->SetProperty(
aura::client::kAppIconLargeKey,
new gfx::ImageSkia(
*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
IDR_ASH_SHELF_ICON_TASK_MANAGER)));
}
#endif #endif
return g_task_manager_view->table_model_.get(); return g_task_manager_view->table_model_.get();
} }
......
...@@ -63,12 +63,6 @@ interface WindowManager { ...@@ -63,12 +63,6 @@ interface WindowManager {
// A boolean determining whether animations are disabled for the window. // A boolean determining whether animations are disabled for the window.
const string kAnimationsDisabled_Property = "prop:animations-disabled"; const string kAnimationsDisabled_Property = "prop:animations-disabled";
// A large version of the application icon. Type: SkBitmap
const string kAppIconLarge_Property = "prop:app-icon-large";
// A small version of the application icon. Type: SkBitmap
const string kAppIconSmall_Property = "prop:app-icon-small";
// The avatar icon to display in the frame header, if any. Type: SkBitmap // The avatar icon to display in the frame header, if any. Type: SkBitmap
const string kAvatarIcon_Property = "prop:avatar-icon"; const string kAvatarIcon_Property = "prop:avatar-icon";
......
...@@ -44,8 +44,6 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kActivateOnPointerKey, true) ...@@ -44,8 +44,6 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kActivateOnPointerKey, true)
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kAlwaysOnTopKey, false) DEFINE_UI_CLASS_PROPERTY_KEY(bool, kAlwaysOnTopKey, false)
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kAnimationsDisabledKey, false) DEFINE_UI_CLASS_PROPERTY_KEY(bool, kAnimationsDisabledKey, false)
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::ImageSkia, kAppIconKey, nullptr) DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::ImageSkia, kAppIconKey, nullptr)
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::ImageSkia, kAppIconLargeKey, nullptr)
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::ImageSkia, kAppIconSmallKey, nullptr)
DEFINE_UI_CLASS_PROPERTY_KEY(int, kAppType, 0) DEFINE_UI_CLASS_PROPERTY_KEY(int, kAppType, 0)
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::SizeF, kAspectRatio, nullptr) DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::SizeF, kAspectRatio, nullptr)
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::ImageSkia, kAvatarIconKey, nullptr) DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::ImageSkia, kAvatarIconKey, nullptr)
......
...@@ -52,16 +52,6 @@ AURA_EXPORT extern const WindowProperty<bool>* const kAnimationsDisabledKey; ...@@ -52,16 +52,6 @@ AURA_EXPORT extern const WindowProperty<bool>* const kAnimationsDisabledKey;
// This is not transported to the window service. // This is not transported to the window service.
AURA_EXPORT extern const WindowProperty<gfx::ImageSkia*>* const kAppIconKey; AURA_EXPORT extern const WindowProperty<gfx::ImageSkia*>* const kAppIconKey;
// A property key to store a large version of the app icon, which is
// transported to the window service.
AURA_EXPORT extern const WindowProperty<gfx::ImageSkia*>* const
kAppIconLargeKey;
// A property key to store a smaller version of the app icon, which is
// transported to the window service.
AURA_EXPORT extern const WindowProperty<gfx::ImageSkia*>* const
kAppIconSmallKey;
// A property key to store the type of window that will be used to record // A property key to store the type of window that will be used to record
// pointer metrics. See AppType in ash/public/cpp/app_types.h for more details. // pointer metrics. See AppType in ash/public/cpp/app_types.h for more details.
AURA_EXPORT extern const WindowProperty<int>* const kAppType; AURA_EXPORT extern const WindowProperty<int>* const kAppType;
......
...@@ -72,10 +72,6 @@ PropertyConverter::CreateAcceptAnyValueCallback() { ...@@ -72,10 +72,6 @@ PropertyConverter::CreateAcceptAnyValueCallback() {
PropertyConverter::PropertyConverter() { PropertyConverter::PropertyConverter() {
// Add known aura properties with associated mus properties. // Add known aura properties with associated mus properties.
RegisterImageSkiaProperty(client::kAppIconLargeKey,
ws::mojom::WindowManager::kAppIconLarge_Property);
RegisterImageSkiaProperty(client::kAppIconSmallKey,
ws::mojom::WindowManager::kAppIconSmall_Property);
RegisterImageSkiaProperty(client::kAvatarIconKey, RegisterImageSkiaProperty(client::kAvatarIconKey,
ws::mojom::WindowManager::kAvatarIcon_Property); ws::mojom::WindowManager::kAvatarIcon_Property);
RegisterPrimitiveProperty(client::kAlwaysOnTopKey, RegisterPrimitiveProperty(client::kAlwaysOnTopKey,
......
...@@ -874,22 +874,7 @@ void DesktopWindowTreeHostMus::SetAspectRatio(const gfx::SizeF& aspect_ratio) { ...@@ -874,22 +874,7 @@ void DesktopWindowTreeHostMus::SetAspectRatio(const gfx::SizeF& aspect_ratio) {
} }
void DesktopWindowTreeHostMus::SetWindowIcons(const gfx::ImageSkia& window_icon, void DesktopWindowTreeHostMus::SetWindowIcons(const gfx::ImageSkia& window_icon,
const gfx::ImageSkia& app_icon) { const gfx::ImageSkia& app_icon) {}
// In Ash, the app icon is always used in preference to the window icon, so
// ignore the window icon. The max size that ash needs is 24dip, which is
// kIconSize in caption_container_view.cc.
constexpr gfx::Size kMaxUsefulAppIconSize(24, 24);
DCHECK_EQ(app_icon.width(), app_icon.height());
gfx::ImageSkia app_icon_resized =
app_icon.width() > kMaxUsefulAppIconSize.width()
? gfx::ImageSkiaOperations::CreateResizedImage(
app_icon, skia::ImageOperations::RESIZE_BEST,
kMaxUsefulAppIconSize)
: app_icon;
window()->GetRootWindow()->SetProperty(aura::client::kAppIconSmallKey,
new gfx::ImageSkia(app_icon_resized));
}
void DesktopWindowTreeHostMus::InitModalType(ui::ModalType modal_type) { void DesktopWindowTreeHostMus::InitModalType(ui::ModalType modal_type) {
// See comment in Init() related to |InitParams::parent| as to why this DCHECK // See comment in Init() related to |InitParams::parent| as to why this DCHECK
......
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