Commit 9fbbb56b authored by James Cook's avatar James Cook Committed by Commit Bot

Eliminate a parameter from ash::NonClientFrameController

The |window_type| is always ws::mojom::WindowType::WINDOW, so it
doesn't need to be a parameter.

Bug: none
Change-Id: Id0ec9146d64e9653983f12945a1436083371633c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1506110
Auto-Submit: James Cook <jamescook@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638284}
parent 84fe619b
...@@ -233,7 +233,6 @@ NonClientFrameController::NonClientFrameController( ...@@ -233,7 +233,6 @@ NonClientFrameController::NonClientFrameController(
aura::Window* parent, aura::Window* parent,
aura::Window* context, aura::Window* context,
const gfx::Rect& bounds, const gfx::Rect& bounds,
ws::mojom::WindowType window_type,
aura::PropertyConverter* property_converter, aura::PropertyConverter* property_converter,
std::map<std::string, std::vector<uint8_t>>* properties) std::map<std::string, std::vector<uint8_t>>* properties)
: widget_(new views::Widget), : widget_(new views::Widget),
...@@ -242,12 +241,7 @@ NonClientFrameController::NonClientFrameController( ...@@ -242,12 +241,7 @@ NonClientFrameController::NonClientFrameController(
// we need to ensure we don't inadvertently change random properties of the // we need to ensure we don't inadvertently change random properties of the
// underlying ui::Window. For example, showing the Widget shouldn't change // underlying ui::Window. For example, showing the Widget shouldn't change
// the bounds of the ui::Window in anyway. // the bounds of the ui::Window in anyway.
// views::Widget::InitParams params;
// Assertions around InitParams::Type matching ws::mojom::WindowType exist in
// MusClient.
views::Widget::InitParams params(
static_cast<views::Widget::InitParams::Type>(window_type));
DCHECK_EQ(ws::mojom::WindowType::WINDOW, window_type);
DCHECK((parent && !context) || (!parent && context)); DCHECK((parent && !context) || (!parent && context));
params.parent = parent; params.parent = parent;
params.context = context; params.context = context;
...@@ -264,7 +258,7 @@ NonClientFrameController::NonClientFrameController( ...@@ -264,7 +258,7 @@ NonClientFrameController::NonClientFrameController(
window_->SetProperty(kWidgetCreationTypeKey, WidgetCreationType::FOR_CLIENT); window_->SetProperty(kWidgetCreationTypeKey, WidgetCreationType::FOR_CLIENT);
window_->AddObserver(this); window_->AddObserver(this);
params.native_widget = native_widget; params.native_widget = native_widget;
aura::SetWindowType(window_, window_type); aura::SetWindowType(window_, ws::mojom::WindowType::WINDOW);
for (auto& property_pair : *properties) { for (auto& property_pair : *properties) {
property_converter->SetPropertyFromTransportValue( property_converter->SetPropertyFromTransportValue(
window_, property_pair.first, &property_pair.second); window_, property_pair.first, &property_pair.second);
......
...@@ -29,9 +29,6 @@ class Insets; ...@@ -29,9 +29,6 @@ class Insets;
} }
namespace ws { namespace ws {
namespace mojom {
enum class WindowType;
}
class TopLevelProxyWindow; class TopLevelProxyWindow;
} // namespace ws } // namespace ws
...@@ -54,7 +51,6 @@ class ASH_EXPORT NonClientFrameController : public views::WidgetDelegate, ...@@ -54,7 +51,6 @@ class ASH_EXPORT NonClientFrameController : public views::WidgetDelegate,
aura::Window* parent, aura::Window* parent,
aura::Window* context, aura::Window* context,
const gfx::Rect& bounds, const gfx::Rect& bounds,
ws::mojom::WindowType window_type,
aura::PropertyConverter* property_converter, aura::PropertyConverter* property_converter,
std::map<std::string, std::vector<uint8_t>>* properties); std::map<std::string, std::vector<uint8_t>>* properties);
......
...@@ -145,8 +145,8 @@ aura::Window* CreateAndParentTopLevelWindowInRoot( ...@@ -145,8 +145,8 @@ aura::Window* CreateAndParentTopLevelWindowInRoot(
// See NonClientFrameController for details on lifetime. // See NonClientFrameController for details on lifetime.
NonClientFrameController* non_client_frame_controller = NonClientFrameController* non_client_frame_controller =
new NonClientFrameController(top_level_proxy_window, container_window, new NonClientFrameController(top_level_proxy_window, container_window,
context, bounds, window_type, context, bounds, property_converter,
property_converter, properties); properties);
return non_client_frame_controller->window(); return non_client_frame_controller->window();
} }
......
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