Skip to content

Commit

Permalink
Moves components/mus/example/wm to mash/wm
Browse files Browse the repository at this point in the history
First of many.

BUG=none
TEST=none
R=ben@chromium.org

Review URL: https://codereview.chromium.org/1458623003

Cr-Commit-Position: refs/heads/master@{#360239}
  • Loading branch information
sky authored and Commit bot committed Nov 18, 2015
1 parent dc3d2f0 commit b044635
Show file tree
Hide file tree
Showing 34 changed files with 115 additions and 93 deletions.
1 change: 1 addition & 0 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ check_targets = [

#"//jingle/*",
"//mandoline/*",
"//mash/*",

#"//media/*", # Lots of errors.
"mojo/*",
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ source_set("browser") {
"//ui/views/mus:for_component",
]
defines += [ "MOJO_SHELL_CLIENT" ]
data_deps += [ "//components/mus/example/wm:example_wm" ]
data_deps += [ "//mash/wm:example_wm" ]
}
if (ui_compositor_image_transport) {
deps += [ "//ui/gl" ]
Expand Down
4 changes: 2 additions & 2 deletions components/mus/example/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ group("example") {
"//components/mus/example/mock_sysui",
"//components/mus/example/views_examples",
"//components/mus/example/window_type_launcher",
"//components/mus/example/wm",
"//mash/wm",
"//mojo/runner",
]
}
Expand All @@ -33,7 +33,7 @@ test("mustash_unittests") {
"//base/test:run_all_unittests",
"//base/test:test_config",
"//base/test:test_support",
"//components/mus/example/wm:unittests",
"//mash/wm:unittests",
"//mojo/platform_handle:platform_handle_impl",
]
}
3 changes: 3 additions & 0 deletions components/mus/example/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include_rules = [
"+mash",
]
2 changes: 1 addition & 1 deletion components/mus/example/mock_sysui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ mojo_native_application("mock_sysui") {

deps = [
"//base",
"//components/mus/example/wm/public/interfaces",
"//components/mus/public/cpp",
"//components/mus/public/interfaces",
"//mash/wm/public/interfaces",
"//mojo/application/public/cpp",
"//mojo/common:common_base",
"//skia",
Expand Down
10 changes: 5 additions & 5 deletions components/mus/example/mock_sysui/mock_sysui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include "components/mus/example/mock_sysui/mock_sysui.h"

#include "components/mus/example/wm/public/interfaces/container.mojom.h"
#include "components/mus/public/cpp/property_type_converters.h"
#include "mash/wm/public/interfaces/container.mojom.h"
#include "mojo/application/public/cpp/application_connection.h"
#include "mojo/application/public/cpp/application_impl.h"
#include "ui/gfx/canvas.h"
Expand All @@ -25,9 +25,9 @@ class DesktopBackground : public views::WidgetDelegateView {
params.delegate = new DesktopBackground;

std::map<std::string, std::vector<uint8_t>> properties;
properties[ash::mojom::kWindowContainer_Property] =
properties[mash::wm::mojom::kWindowContainer_Property] =
mojo::TypeConverter<const std::vector<uint8_t>, int32_t>::Convert(
ash::mojom::CONTAINER_USER_BACKGROUND);
mash::wm::mojom::CONTAINER_USER_BACKGROUND);
mus::Window* window =
views::WindowManagerConnection::Get()->NewWindow(properties);
params.native_widget = new views::NativeWidgetMus(
Expand Down Expand Up @@ -60,9 +60,9 @@ class Shelf : public views::WidgetDelegateView {
params.delegate = new Shelf;

std::map<std::string, std::vector<uint8_t>> properties;
properties[ash::mojom::kWindowContainer_Property] =
properties[mash::wm::mojom::kWindowContainer_Property] =
mojo::TypeConverter<const std::vector<uint8_t>, int32_t>::Convert(
ash::mojom::CONTAINER_USER_SHELF);
mash::wm::mojom::CONTAINER_USER_SHELF);
mus::Window* window =
views::WindowManagerConnection::Get()->NewWindow(properties);
params.native_widget = new views::NativeWidgetMus(
Expand Down
14 changes: 14 additions & 0 deletions mash/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
include_rules = [
"+components/mus/common/types.h",
"+components/mus/common/util.h",
"+components/mus/public",
"+mojo/application",
"+mojo/common",
"+mojo/converters",
"+mojo/public",
"+mojo/services/network/public",
"+mojo/services/tracing/public",
"+third_party/mojo_services",
"+third_party/skia/include",
"+ui",
]
4 changes: 4 additions & 0 deletions mash/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ben@chromium.org
erg@chromium.org
msw@chromium.org
sky@chromium.org
2 changes: 1 addition & 1 deletion components/mus/example/wm/BUILD.gn → mash/wm/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ source_set("example_wm_lib") {

deps = [
"//base",
"//components/mus/example/wm/public/interfaces",
"//components/mus/common",
"//components/mus/public/cpp",
"//components/mus/public/interfaces",
"//mash/wm/public/interfaces",
"//mojo/application/public/cpp",
"//mojo/common:common_base",
"//mojo/converters/geometry",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/mus/example/wm/background_layout.h"
#include "mash/wm/background_layout.h"

#include "components/mus/public/cpp/window.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_MUS_EXAMPLE_WM_BACKGROUND_LAYOUT_H_
#define COMPONENTS_MUS_EXAMPLE_WM_BACKGROUND_LAYOUT_H_
#ifndef MASH_WM_BACKGROUND_LAYOUT_H_
#define MASH_WM_BACKGROUND_LAYOUT_H_

#include "base/macros.h"
#include "components/mus/example/wm/layout_manager.h"
#include "mash/wm/layout_manager.h"

// Lays out the desktop background within background containers.
class BackgroundLayout : public LayoutManager {
Expand All @@ -22,4 +22,4 @@ class BackgroundLayout : public LayoutManager {
DISALLOW_COPY_AND_ASSIGN(BackgroundLayout);
};

#endif // COMPONENTS_MUS_EXAMPLE_WM_BACKGROUND_LAYOUT_H_
#endif // MASH_WM_BACKGROUND_LAYOUT_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/mus/example/wm/layout_manager.h"
#include "mash/wm/layout_manager.h"

#include "components/mus/public/cpp/property_type_converters.h"
#include "components/mus/public/cpp/window.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_MUS_EXAMPLE_WM_LAYOUT_MANAGER_H_
#define COMPONENTS_MUS_EXAMPLE_WM_LAYOUT_MANAGER_H_
#ifndef MASH_WM_LAYOUT_MANAGER_H_
#define MASH_WM_LAYOUT_MANAGER_H_

#include "base/macros.h"
#include "components/mus/public/cpp/window_observer.h"
Expand Down Expand Up @@ -50,4 +50,4 @@ class LayoutManager : public mus::WindowObserver {
DISALLOW_COPY_AND_ASSIGN(LayoutManager);
};

#endif // COMPONENTS_MUS_EXAMPLE_WM_LAYOUT_MANAGER_H_
#endif // MASH_WM_LAYOUT_MANAGER_H_
2 changes: 1 addition & 1 deletion components/mus/example/wm/main.cc → mash/wm/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/mus/example/wm/window_manager_application.h"
#include "mash/wm/window_manager_application.h"
#include "mojo/application/public/cpp/application_runner.h"
#include "mojo/public/c/system/main.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/mus/example/wm/move_loop.h"
#include "mash/wm/move_loop.h"

#include "base/auto_reset.h"
#include "components/mus/example/wm/property_util.h"
#include "components/mus/public/cpp/window.h"
#include "components/mus/public/interfaces/input_event_constants.mojom.h"
#include "mash/wm/property_util.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/rect.h"

Expand Down
6 changes: 3 additions & 3 deletions components/mus/example/wm/move_loop.h → mash/wm/move_loop.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_MUS_EXAMPLE_WM_MOVE_LOOP_H_
#define COMPONENTS_MUS_EXAMPLE_WM_MOVE_LOOP_H_
#ifndef MASH_WM_MOVE_LOOP_H_
#define MASH_WM_MOVE_LOOP_H_

#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
Expand Down Expand Up @@ -112,4 +112,4 @@ class MoveLoop : public mus::WindowObserver {
DISALLOW_COPY_AND_ASSIGN(MoveLoop);
};

#endif // COMPONENTS_MUS_EXAMPLE_WM_MOVE_LOOP_H_
#endif // MASH_WM_MOVE_LOOP_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/mus/example/wm/move_loop.h"
#include "mash/wm/move_loop.h"

#include "components/mus/public/cpp/tests/test_window.h"
#include "mojo/converters/input_events/input_events_type_converters.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/mus/example/wm/non_client_frame_controller.h"
#include "mash/wm/non_client_frame_controller.h"

#include "components/mus/example/wm/non_client_frame_view_impl.h"
#include "components/mus/example/wm/property_util.h"
#include "components/mus/public/cpp/window.h"
#include "mash/wm/non_client_frame_view_impl.h"
#include "mash/wm/property_util.h"
#include "ui/views/mus/native_widget_mus.h"
#include "ui/views/widget/widget.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_MUS_EXAMPLE_WM_NON_CLIENT_FRAME_CONTROLLER_H_
#define COMPONENTS_MUS_EXAMPLE_WM_NON_CLIENT_FRAME_CONTROLLER_H_
#ifndef MASH_WM_NON_CLIENT_FRAME_CONTROLLER_H_
#define MASH_WM_NON_CLIENT_FRAME_CONTROLLER_H_

#include "base/macros.h"
#include "components/mus/public/cpp/window_observer.h"
Expand Down Expand Up @@ -50,4 +50,4 @@ class NonClientFrameController : public views::WidgetDelegateView,
DISALLOW_COPY_AND_ASSIGN(NonClientFrameController);
};

#endif // COMPONENTS_MUS_EXAMPLE_WM_NON_CLIENT_FRAME_CONTROLLER_H_
#endif // MASH_WM_NON_CLIENT_FRAME_CONTROLLER_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/mus/example/wm/non_client_frame_view_impl.h"
#include "mash/wm/non_client_frame_view_impl.h"

#include "components/mus/example/wm/move_loop.h"
#include "components/mus/public/cpp/window.h"
#include "mash/wm/move_loop.h"
#include "mojo/converters/input_events/input_events_type_converters.h"
#include "ui/compositor/paint_recorder.h"
#include "ui/gfx/canvas.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_MUS_EXAMPLE_WM_NON_CLIENT_FRAME_VIEW_IMPL_H_
#define COMPONENTS_MUS_EXAMPLE_WM_NON_CLIENT_FRAME_VIEW_IMPL_H_
#ifndef MASH_WM_NON_CLIENT_FRAME_VIEW_IMPL_H_
#define MASH_WM_NON_CLIENT_FRAME_VIEW_IMPL_H_

#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
Expand Down Expand Up @@ -46,4 +46,4 @@ class NonClientFrameViewImpl : public views::CustomFrameView,
DISALLOW_COPY_AND_ASSIGN(NonClientFrameViewImpl);
};

#endif // COMPONENTS_MUS_EXAMPLE_WM_NON_CLIENT_FRAME_VIEW_IMPL_H_
#endif // MASH_WM_NON_CLIENT_FRAME_VIEW_IMPL_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/mus/example/wm/property_util.h"
#include "mash/wm/property_util.h"

#include "components/mus/public/cpp/property_type_converters.h"
#include "components/mus/public/cpp/window.h"
Expand All @@ -12,7 +12,7 @@

mus::mojom::ShowState GetWindowShowState(const mus::Window* window) {
if (window->HasSharedProperty(
mus::mojom::WindowManager::kShowState_Property)) {
mus::mojom::WindowManager::kShowState_Property)) {
return static_cast<mus::mojom::ShowState>(
window->GetSharedProperty<int32_t>(
mus::mojom::WindowManager::kShowState_Property));
Expand All @@ -32,7 +32,7 @@ void SetWindowUserSetBounds(mus::Window* window, const gfx::Rect& bounds) {

gfx::Rect GetWindowUserSetBounds(const mus::Window* window) {
if (window->HasSharedProperty(
mus::mojom::WindowManager::kUserSetBounds_Property)) {
mus::mojom::WindowManager::kUserSetBounds_Property)) {
return window->GetSharedProperty<gfx::Rect>(
mus::mojom::WindowManager::kUserSetBounds_Property);
}
Expand All @@ -46,20 +46,20 @@ void SetWindowPreferredSize(mus::Window* window, const gfx::Size& size) {

gfx::Size GetWindowPreferredSize(const mus::Window* window) {
if (window->HasSharedProperty(
mus::mojom::WindowManager::kPreferredSize_Property)) {
mus::mojom::WindowManager::kPreferredSize_Property)) {
return window->GetSharedProperty<gfx::Size>(
mus::mojom::WindowManager::kPreferredSize_Property);
}
return gfx::Size();
}

ash::mojom::Container GetRequestedContainer(const mus::Window* window) {
if (window->HasSharedProperty(ash::mojom::kWindowContainer_Property)) {
return static_cast<ash::mojom::Container>(
mash::wm::mojom::Container GetRequestedContainer(const mus::Window* window) {
if (window->HasSharedProperty(mash::wm::mojom::kWindowContainer_Property)) {
return static_cast<mash::wm::mojom::Container>(
window->GetSharedProperty<int32_t>(
ash::mojom::kWindowContainer_Property));
mash::wm::mojom::kWindowContainer_Property));
}
return ash::mojom::CONTAINER_USER_WINDOWS;
return mash::wm::mojom::CONTAINER_USER_WINDOWS;
}

mus::mojom::ResizeBehavior GetResizeBehavior(const mus::Window* window) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_MUS_EXAMPLE_WM_PROPERTY_UTIL_H_
#define COMPONENTS_MUS_EXAMPLE_WM_PROPERTY_UTIL_H_
#ifndef MASH_WM_PROPERTY_UTIL_H_
#define MASH_WM_PROPERTY_UTIL_H_

#include "components/mus/example/wm/public/interfaces/container.mojom.h"
#include "components/mus/public/interfaces/window_manager.mojom.h"
#include "components/mus/public/interfaces/window_manager_constants.mojom.h"
#include "mash/wm/public/interfaces/container.mojom.h"

namespace gfx {
class Rect;
Expand All @@ -29,11 +29,11 @@ gfx::Rect GetWindowUserSetBounds(const mus::Window* window);
void SetWindowPreferredSize(mus::Window* window, const gfx::Size& size);
gfx::Size GetWindowPreferredSize(const mus::Window* window);

ash::mojom::Container GetRequestedContainer(const mus::Window* window);
mash::wm::mojom::Container GetRequestedContainer(const mus::Window* window);

mus::mojom::ResizeBehavior GetResizeBehavior(const mus::Window* window);

void SetRestoreBounds(mus::Window* window, const gfx::Rect& bounds);
gfx::Rect GetRestoreBounds(const mus::Window* window);

#endif // COMPONENTS_MUS_EXAMPLE_WM_PROPERTY_UTIL_H_
#endif // MASH_WM_PROPERTY_UTIL_H_
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module ash.mojom;
module mash.wm.mojom;

enum Container {
ALL_USER_BACKGROUND = 1,
Expand Down
Loading

0 comments on commit b044635

Please sign in to comment.