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

Side by Side Diff: services/ui/test_wm/test_wm.cc

Issue 2346253004: Makes display roots be destroyed by client (Closed)
Patch Set: cleanup Created 4 years, 3 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 | « services/ui/public/interfaces/window_manager.mojom ('k') | services/ui/ws/display.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 <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "mojo/public/cpp/bindings/binding.h" 8 #include "mojo/public/cpp/bindings/binding.h"
9 #include "services/shell/public/c/main.h" 9 #include "services/shell/public/c/main.h"
10 #include "services/shell/public/cpp/connector.h" 10 #include "services/shell/public/cpp/connector.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 DCHECK(!root_); 82 DCHECK(!root_);
83 root_ = window; 83 root_ = window;
84 DCHECK(window_manager_client_); 84 DCHECK(window_manager_client_);
85 window_manager_client_->AddActivationParent(root_); 85 window_manager_client_->AddActivationParent(root_);
86 ui::mojom::FrameDecorationValuesPtr frame_decoration_values = 86 ui::mojom::FrameDecorationValuesPtr frame_decoration_values =
87 ui::mojom::FrameDecorationValues::New(); 87 ui::mojom::FrameDecorationValues::New();
88 frame_decoration_values->max_title_bar_button_width = 0; 88 frame_decoration_values->max_title_bar_button_width = 0;
89 window_manager_client_->SetFrameDecorationValues( 89 window_manager_client_->SetFrameDecorationValues(
90 std::move(frame_decoration_values)); 90 std::move(frame_decoration_values));
91 } 91 }
92 void OnWmDisplayRemoved(ui::Window* window) override { window->Destroy(); }
92 void OnWmPerformMoveLoop(Window* window, 93 void OnWmPerformMoveLoop(Window* window,
93 mojom::MoveLoopSource source, 94 mojom::MoveLoopSource source,
94 const gfx::Point& cursor_location, 95 const gfx::Point& cursor_location,
95 const base::Callback<void(bool)>& on_done) override { 96 const base::Callback<void(bool)>& on_done) override {
96 // Don't care. 97 // Don't care.
97 } 98 }
98 void OnWmCancelMoveLoop(Window* window) override {} 99 void OnWmCancelMoveLoop(Window* window) override {}
99 100
100 ui::Window* root_ = nullptr; 101 ui::Window* root_ = nullptr;
101 ui::WindowManagerClient* window_manager_client_ = nullptr; 102 ui::WindowManagerClient* window_manager_client_ = nullptr;
102 std::unique_ptr<ui::WindowTreeClient> window_tree_client_; 103 std::unique_ptr<ui::WindowTreeClient> window_tree_client_;
103 104
104 DISALLOW_COPY_AND_ASSIGN(TestWM); 105 DISALLOW_COPY_AND_ASSIGN(TestWM);
105 }; 106 };
106 107
107 } // namespace test 108 } // namespace test
108 } // namespace ui 109 } // namespace ui
109 110
110 MojoResult ServiceMain(MojoHandle service_request_handle) { 111 MojoResult ServiceMain(MojoHandle service_request_handle) {
111 shell::ServiceRunner runner(new ui::test::TestWM); 112 shell::ServiceRunner runner(new ui::test::TestWM);
112 return runner.Run(service_request_handle); 113 return runner.Run(service_request_handle);
113 } 114 }
OLDNEW
« no previous file with comments | « services/ui/public/interfaces/window_manager.mojom ('k') | services/ui/ws/display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698