Commit c5c029fd authored by sky's avatar sky Committed by Commit bot

Removes some dead code and includes

No longer needed.

BUG=674757
TEST=none
R=jamescook@chromium.org

Review-Url: https://codereview.chromium.org/2578373002
Cr-Commit-Position: refs/heads/master@{#439009}
parent 4af2926f
......@@ -14,8 +14,6 @@
#include "ash/mus/window_manager.h"
#include "base/logging.h"
#include "services/ui/common/accelerator_util.h"
#include "services/ui/public/cpp/window_manager_delegate.h"
#include "services/ui/public/cpp/window_tree_client.h"
#include "ui/base/accelerators/accelerator_history.h"
namespace ash {
......
// 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/bridge/mus_layout_manager_adapter.h"
#include "ash/common/wm_layout_manager.h"
#include "ash/mus/bridge/wm_window_mus.h"
#include "services/ui/public/cpp/window.h"
namespace ash {
namespace mus {
MusLayoutManagerAdapter::MusLayoutManagerAdapter(
ui::Window* window,
std::unique_ptr<WmLayoutManager> layout_manager)
: window_(window),
layout_manager_(std::move(layout_manager)) {
window_->AddObserver(this);
}
MusLayoutManagerAdapter::~MusLayoutManagerAdapter() {
window_->RemoveObserver(this);
}
void MusLayoutManagerAdapter::OnTreeChanging(const TreeChangeParams& params) {
if (params.old_parent == window_) {
layout_manager_->OnWillRemoveWindowFromLayout(
WmWindowMus::Get(params.target));
}
}
void MusLayoutManagerAdapter::OnTreeChanged(const TreeChangeParams& params) {
if (params.new_parent == window_)
layout_manager_->OnWindowAddedToLayout(WmWindowMus::Get(params.target));
else if (params.old_parent == window_)
layout_manager_->OnWindowRemovedFromLayout(WmWindowMus::Get(params.target));
}
void MusLayoutManagerAdapter::OnWindowBoundsChanged(
ui::Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) {
layout_manager_->OnWindowResized();
}
void MusLayoutManagerAdapter::OnChildWindowVisibilityChanged(ui::Window* window,
bool visible) {
layout_manager_->OnChildWindowVisibilityChanged(WmWindowMus::Get(window),
visible);
}
} // namespace mus
} // namespace ash
// 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.
#ifndef ASH_MUS_BRIDGE_MUS_LAYOUT_MANAGER_ADAPTER_H_
#define ASH_MUS_BRIDGE_MUS_LAYOUT_MANAGER_ADAPTER_H_
#include <memory>
#include "base/macros.h"
#include "services/ui/public/cpp/window_observer.h"
namespace ash {
class WmLayoutManager;
namespace mus {
// Used to associate a ui::Window with an WmLayoutManager. This
// attaches an observer to the ui::Window and calls the appropriate methods on
// the WmLayoutManager at the appropriate time.
//
// NOTE: WmLayoutManager provides the function SetChildBounds(). This is
// expected to be called to change the bounds of the Window. For aura this
// function is called by way of aura exposing a hook (aura::LayoutManager). Mus
// has no such hook. To ensure SetChildBounds() is called correctly all bounds
// changes to ui::Windows must be routed through WmWindowMus. WmWindowMus
// ensures WmLayoutManager::SetChildBounds() is called appropriately.
class MusLayoutManagerAdapter : public ui::WindowObserver {
public:
MusLayoutManagerAdapter(ui::Window* window,
std::unique_ptr<WmLayoutManager> layout_manager);
~MusLayoutManagerAdapter() override;
WmLayoutManager* layout_manager() { return layout_manager_.get(); }
private:
// ui::WindowObserver:
void OnTreeChanging(const TreeChangeParams& params) override;
void OnTreeChanged(const TreeChangeParams& params) override;
void OnWindowBoundsChanged(ui::Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) override;
void OnChildWindowVisibilityChanged(ui::Window* window,
bool visible) override;
ui::Window* window_;
std::unique_ptr<WmLayoutManager> layout_manager_;
DISALLOW_COPY_AND_ASSIGN(MusLayoutManagerAdapter);
};
} // namespace mus
} // namespace ash
#endif // ASH_MUS_BRIDGE_MUS_LAYOUT_MANAGER_ADAPTER_H_
......@@ -13,7 +13,6 @@
#include "ash/common/wm_transient_window_observer.h"
#include "ash/common/wm_window_observer.h"
#include "ash/common/wm_window_property.h"
#include "ash/mus/bridge/mus_layout_manager_adapter.h"
#include "ash/mus/bridge/wm_root_window_controller_mus.h"
#include "ash/mus/bridge/wm_shell_mus.h"
#include "ash/mus/property_util.h"
......
......@@ -8,8 +8,6 @@
#include "ash/mus/bridge/wm_window_mus.h"
#include "base/memory/ptr_util.h"
#include "services/ui/public/cpp/property_type_converters.h"
#include "services/ui/public/cpp/window.h"
#include "services/ui/public/cpp/window_property.h"
#include "services/ui/public/interfaces/window_manager.mojom.h"
#include "ui/wm/core/window_util.h"
......
// Copyright 2015 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.
#ifndef MASH_EXAMPLE_COMMON_MUS_VIEWS_INIT_H_
#define MASH_EXAMPLE_COMMON_MUS_VIEWS_INIT_H_
#include <memory>
#include "base/macros.h"
#include "services/ui/public/cpp/window_tree_client_delegate.h"
#include "services/ui/public/interfaces/window_manager.mojom.h"
#include "ui/views/mus/aura_init.h"
#include "ui/views/views_delegate.h"
namespace service_manager {
class ServiceContext;
}
namespace views {
class AuraInit;
}
// Does the necessary setup to use mus, views and the example wm.
class MUSViewsInit : public views::ViewsDelegate,
public ui::WindowTreeClientDelegate {
public:
explicit MUSViewsInit(service_manager::ServiceContext* app);
~MUSViewsInit() override;
private:
ui::Window* NewWindow();
// views::ViewsDelegate:
views::NativeWidget* CreateNativeWidget(
views::internal::NativeWidgetDelegate* delegate) override;
void OnBeforeWidgetInit(
views::Widget::InitParams* params,
views::internal::NativeWidgetDelegate* delegate) override;
// ui::WindowTreeClientDelegate:
void OnEmbed(ui::Window* root) override;
void OnDidDestroyClient(ui::WindowTreeClient* client) override;
#if defined(OS_WIN)
HICON GetSmallWindowIcon() const override;
#endif
service_manager::ServiceContext* app_;
std::unique_ptr<views::AuraInit> aura_init_;
ui::mojom::WindowManagerPtr window_manager_;
DISALLOW_COPY_AND_ASSIGN(MUSViewsInit);
};
#endif // MASH_EXAMPLE_COMMON_MUS_VIEWS_INIT_H_
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