OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mash/example/mock_sysui/mock_sysui.h" | 5 #include "mash/system_ui/system_ui.h" |
6 | 6 |
7 #include "components/mus/public/cpp/property_type_converters.h" | 7 #include "components/mus/public/cpp/property_type_converters.h" |
8 #include "mash/wm/public/interfaces/container.mojom.h" | 8 #include "mash/wm/public/interfaces/container.mojom.h" |
9 #include "mojo/application/public/cpp/application_connection.h" | 9 #include "mojo/application/public/cpp/application_connection.h" |
10 #include "mojo/application/public/cpp/application_impl.h" | 10 #include "mojo/application/public/cpp/application_impl.h" |
11 #include "ui/gfx/canvas.h" | 11 #include "ui/gfx/canvas.h" |
12 #include "ui/views/mus/aura_init.h" | 12 #include "ui/views/mus/aura_init.h" |
13 #include "ui/views/mus/native_widget_mus.h" | 13 #include "ui/views/mus/native_widget_mus.h" |
14 #include "ui/views/mus/window_manager_connection.h" | 14 #include "ui/views/mus/window_manager_connection.h" |
15 #include "ui/views/widget/widget_delegate.h" | 15 #include "ui/views/widget/widget_delegate.h" |
16 | 16 |
| 17 namespace mash { |
| 18 namespace system_ui { |
| 19 |
17 namespace { | 20 namespace { |
18 | 21 |
19 class DesktopBackground : public views::WidgetDelegateView { | 22 class DesktopBackground : public views::WidgetDelegateView { |
20 public: | 23 public: |
21 static void Create(mojo::Shell* shell) { | 24 static void Create(mojo::Shell* shell) { |
22 views::Widget* widget = new views::Widget; | 25 views::Widget* widget = new views::Widget; |
23 views::Widget::InitParams params( | 26 views::Widget::InitParams params( |
24 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 27 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
25 params.delegate = new DesktopBackground; | 28 params.delegate = new DesktopBackground; |
26 | 29 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 gfx::Size GetPreferredSize() const override { return gfx::Size(1, 48); } | 85 gfx::Size GetPreferredSize() const override { return gfx::Size(1, 48); } |
83 | 86 |
84 // Overridden from views::WidgetDelegate: | 87 // Overridden from views::WidgetDelegate: |
85 views::View* GetContentsView() override { return this; } | 88 views::View* GetContentsView() override { return this; } |
86 | 89 |
87 DISALLOW_COPY_AND_ASSIGN(Shelf); | 90 DISALLOW_COPY_AND_ASSIGN(Shelf); |
88 }; | 91 }; |
89 | 92 |
90 } // namespace | 93 } // namespace |
91 | 94 |
92 MockSysUI::MockSysUI() {} | 95 SystemUI::SystemUI() {} |
93 | 96 |
94 MockSysUI::~MockSysUI() { | 97 SystemUI::~SystemUI() { |
95 } | 98 } |
96 | 99 |
97 void MockSysUI::Initialize(mojo::ApplicationImpl* app) { | 100 void SystemUI::Initialize(mojo::ApplicationImpl* app) { |
98 tracing_.Initialize(app); | 101 tracing_.Initialize(app); |
99 | 102 |
100 aura_init_.reset(new views::AuraInit(app, "views_mus_resources.pak")); | 103 aura_init_.reset(new views::AuraInit(app, "views_mus_resources.pak")); |
101 views::WindowManagerConnection::Create(app); | 104 views::WindowManagerConnection::Create(app); |
102 | 105 |
103 DesktopBackground::Create(app->shell()); | 106 DesktopBackground::Create(app->shell()); |
104 Shelf::Create(app->shell()); | 107 Shelf::Create(app->shell()); |
105 } | 108 } |
106 | 109 |
107 bool MockSysUI::ConfigureIncomingConnection( | 110 bool SystemUI::ConfigureIncomingConnection( |
108 mojo::ApplicationConnection* connection) { | 111 mojo::ApplicationConnection* connection) { |
109 return false; | 112 return true; |
110 } | 113 } |
| 114 |
| 115 } // namespace system_ui |
| 116 } // namespace mash |
OLD | NEW |