Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2345)

Unified Diff: ash/mus/native_widget_factory_mus.cc

Issue 2539363005: Converts ash to use aura-mus (Closed)
Patch Set: merge Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/mus/native_widget_factory_mus.cc
diff --git a/ash/mus/native_widget_factory_mus.cc b/ash/mus/native_widget_factory_mus.cc
deleted file mode 100644
index 9660223a79c9bc1dd0fd61e8785a90fff88af5c2..0000000000000000000000000000000000000000
--- a/ash/mus/native_widget_factory_mus.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2016 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/mus/native_widget_factory_mus.h"
-
-#include "ash/common/wm_shell.h"
-#include "ash/mus/bridge/wm_window_mus.h"
-#include "ash/mus/window_manager.h"
-#include "services/ui/public/cpp/property_type_converters.h"
-#include "ui/views/mus/native_widget_mus.h"
-#include "ui/views/views_delegate.h"
-#include "ui/views/widget/widget.h"
-
-namespace ash {
-namespace mus {
-
-namespace {
-
-views::NativeWidget* CreateNativeWidgetMus(
- WindowManager* window_manager,
- const views::Widget::InitParams& init_params,
- views::internal::NativeWidgetDelegate* delegate) {
- // TYPE_CONTROL widgets require a NativeWidgetAura. So we let this fall
- // through, so that the default NativeWidgetPrivate::CreateNativeWidget() is
- // used instead.
- if (init_params.type == views::Widget::InitParams::TYPE_CONTROL)
- return nullptr;
- std::map<std::string, std::vector<uint8_t>> props;
- views::NativeWidgetMus::ConfigurePropertiesForNewWindow(init_params, &props);
- return new views::NativeWidgetMus(
- delegate, window_manager->NewTopLevelWindow(&props),
- ui::mojom::CompositorFrameSinkType::DEFAULT);
-}
-
-} // namespace
-
-NativeWidgetFactoryMus::NativeWidgetFactoryMus(WindowManager* window_manager) {
- views::ViewsDelegate::GetInstance()->set_native_widget_factory(
- base::Bind(&CreateNativeWidgetMus, window_manager));
-}
-
-NativeWidgetFactoryMus::~NativeWidgetFactoryMus() {
- if (views::ViewsDelegate::GetInstance()) {
- views::ViewsDelegate::GetInstance()->set_native_widget_factory(
- views::ViewsDelegate::NativeWidgetFactory());
- }
-}
-
-} // namespace mus
-} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698