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

Side by Side Diff: ui/views/mus/window_manager_connection.cc

Issue 1676713002: ash/mash: Add a mus-client that sets up ash to provide the system ui for mash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix-cros-build Created 4 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « ui/views/mus/window_manager_connection.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/views/mus/window_manager_connection.h" 5 #include "ui/views/mus/window_manager_connection.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/threading/thread_local.h" 10 #include "base/threading/thread_local.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 void WindowManagerConnection::Reset() { 47 void WindowManagerConnection::Reset() {
48 delete Get(); 48 delete Get();
49 lazy_tls_ptr.Pointer()->Set(nullptr); 49 lazy_tls_ptr.Pointer()->Set(nullptr);
50 } 50 }
51 51
52 mus::Window* WindowManagerConnection::NewWindow( 52 mus::Window* WindowManagerConnection::NewWindow(
53 const std::map<std::string, std::vector<uint8_t>>& properties) { 53 const std::map<std::string, std::vector<uint8_t>>& properties) {
54 return window_tree_connection_->NewTopLevelWindow(&properties); 54 return window_tree_connection_->NewTopLevelWindow(&properties);
55 } 55 }
56 56
57 NativeWidget* WindowManagerConnection::CreateNativeWidgetMus(
58 const Widget::InitParams& init_params,
59 internal::NativeWidgetDelegate* delegate) {
60 std::map<std::string, std::vector<uint8_t>> properties;
61 NativeWidgetMus::ConfigurePropertiesForNewWindow(init_params, &properties);
62 return new NativeWidgetMus(delegate, shell_, NewWindow(properties),
63 mus::mojom::SurfaceType::DEFAULT);
64 }
65
57 WindowManagerConnection::WindowManagerConnection(mojo::Shell* shell) 66 WindowManagerConnection::WindowManagerConnection(mojo::Shell* shell)
58 : shell_(shell), window_tree_connection_(nullptr) { 67 : shell_(shell), window_tree_connection_(nullptr) {
59 window_tree_connection_.reset( 68 window_tree_connection_.reset(
60 mus::WindowTreeConnection::Create(this, shell_)); 69 mus::WindowTreeConnection::Create(this, shell_));
61 70
62 screen_.reset(new ScreenMus(this)); 71 screen_.reset(new ScreenMus(this));
63 screen_->Init(shell); 72 screen_->Init(shell);
64 73
65 ViewsDelegate::GetInstance()->set_native_widget_factory( 74 ViewsDelegate::GetInstance()->set_native_widget_factory(base::Bind(
66 base::Bind(&WindowManagerConnection::CreateNativeWidget, 75 &WindowManagerConnection::CreateNativeWidgetMus, base::Unretained(this)));
67 base::Unretained(this)));
68 } 76 }
69 77
70 WindowManagerConnection::~WindowManagerConnection() { 78 WindowManagerConnection::~WindowManagerConnection() {
71 // ~WindowTreeConnection calls back to us (we're the WindowTreeDelegate), 79 // ~WindowTreeConnection calls back to us (we're the WindowTreeDelegate),
72 // destroy it while we are still valid. 80 // destroy it while we are still valid.
73 window_tree_connection_.reset(); 81 window_tree_connection_.reset();
74 } 82 }
75 83
76 void WindowManagerConnection::OnEmbed(mus::Window* root) {} 84 void WindowManagerConnection::OnEmbed(mus::Window* root) {}
77 85
78 void WindowManagerConnection::OnConnectionLost( 86 void WindowManagerConnection::OnConnectionLost(
79 mus::WindowTreeConnection* connection) {} 87 mus::WindowTreeConnection* connection) {}
80 88
81 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { 89 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() {
82 if (window_tree_connection_) 90 if (window_tree_connection_)
83 NativeWidgetMus::NotifyFrameChanged(window_tree_connection_.get()); 91 NativeWidgetMus::NotifyFrameChanged(window_tree_connection_.get());
84 } 92 }
85 93
86 NativeWidget* WindowManagerConnection::CreateNativeWidget(
87 const Widget::InitParams& init_params,
88 internal::NativeWidgetDelegate* delegate) {
89 std::map<std::string, std::vector<uint8_t>> properties;
90 NativeWidgetMus::ConfigurePropertiesForNewWindow(init_params, &properties);
91 return new NativeWidgetMus(delegate, shell_, NewWindow(properties),
92 mus::mojom::SurfaceType::DEFAULT);
93 }
94
95 } // namespace views 94 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/window_manager_connection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698