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

Side by Side Diff: mash/webtest/webtest.cc

Issue 2018823002: Eliminate WindowTreeConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@connection
Patch Set: . Created 4 years, 6 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 | « mash/example/common/mus_views_init.h ('k') | mash/wm/bridge/wm_globals_mus.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/webtest/webtest.h" 5 #include "mash/webtest/webtest.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "base/timer/timer.h" 13 #include "base/timer/timer.h"
14 #include "components/mus/public/cpp/window.h" 14 #include "components/mus/public/cpp/window.h"
15 #include "components/mus/public/cpp/window_tree_connection.h" 15 #include "components/mus/public/cpp/window_tree_client.h"
16 #include "mash/public/interfaces/launchable.mojom.h" 16 #include "mash/public/interfaces/launchable.mojom.h"
17 #include "mojo/public/c/system/main.h" 17 #include "mojo/public/c/system/main.h"
18 #include "services/navigation/public/interfaces/view.mojom.h" 18 #include "services/navigation/public/interfaces/view.mojom.h"
19 #include "services/shell/public/cpp/application_runner.h" 19 #include "services/shell/public/cpp/application_runner.h"
20 #include "services/shell/public/cpp/connector.h" 20 #include "services/shell/public/cpp/connector.h"
21 #include "services/shell/public/cpp/shell_client.h" 21 #include "services/shell/public/cpp/shell_client.h"
22 #include "services/tracing/public/cpp/tracing_impl.h" 22 #include "services/tracing/public/cpp/tracing_impl.h"
23 #include "ui/aura/mus/mus_util.h" 23 #include "ui/aura/mus/mus_util.h"
24 #include "ui/gfx/canvas.h" 24 #include "ui/gfx/canvas.h"
25 #include "ui/gfx/paint_throbber.h" 25 #include "ui/gfx/paint_throbber.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 int width = local_bounds.width(); 82 int width = local_bounds.width();
83 int height = local_bounds.height(); 83 int height = local_bounds.height();
84 content_area_->SetBounds( 84 content_area_->SetBounds(
85 gfx::Rect(offset.x(), offset.y(), width, height)); 85 gfx::Rect(offset.x(), offset.y(), width, height));
86 } 86 }
87 } 87 }
88 void ViewHierarchyChanged( 88 void ViewHierarchyChanged(
89 const views::View::ViewHierarchyChangedDetails& details) override { 89 const views::View::ViewHierarchyChangedDetails& details) override {
90 if (details.is_add && GetWidget() && !content_area_) { 90 if (details.is_add && GetWidget() && !content_area_) {
91 mus::Window* window = aura::GetMusWindow(GetWidget()->GetNativeWindow()); 91 mus::Window* window = aura::GetMusWindow(GetWidget()->GetNativeWindow());
92 content_area_ = window->connection()->NewWindow(nullptr); 92 content_area_ = window->window_tree()->NewWindow(nullptr);
93 window->AddChild(content_area_); 93 window->AddChild(content_area_);
94 94
95 mus::mojom::WindowTreeClientPtr client; 95 mus::mojom::WindowTreeClientPtr client;
96 view_->GetWindowTreeClient(GetProxy(&client)); 96 view_->GetWindowTreeClient(GetProxy(&client));
97 content_area_->Embed(std::move(client)); 97 content_area_->Embed(std::move(client));
98 } 98 }
99 } 99 }
100 100
101 // navigation::mojom::ViewClient: 101 // navigation::mojom::ViewClient:
102 void LoadingStateChanged(bool is_loading) override {} 102 void LoadingStateChanged(bool is_loading) override {}
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 AddWindow(window); 185 AddWindow(window);
186 } 186 }
187 187
188 void Webtest::Create(shell::Connection* connection, 188 void Webtest::Create(shell::Connection* connection,
189 mojom::LaunchableRequest request) { 189 mojom::LaunchableRequest request) {
190 bindings_.AddBinding(this, std::move(request)); 190 bindings_.AddBinding(this, std::move(request));
191 } 191 }
192 192
193 } // namespace webtest 193 } // namespace webtest
194 } // namespace mash 194 } // namespace mash
OLDNEW
« no previous file with comments | « mash/example/common/mus_views_init.h ('k') | mash/wm/bridge/wm_globals_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698