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

Side by Side Diff: services/ui/ws/test_utils.cc

Issue 2523723002: Update display::Display::kInvalidDisplayID constant. (Closed)
Patch Set: Fix includes. Created 4 years, 1 month 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/ws/test_utils.h ('k') | services/ui/ws/user_display_manager.cc » ('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 "services/ui/ws/test_utils.h" 5 #include "services/ui/ws/test_utils.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 int64_t TestPlatformScreen::AddDisplay( 101 int64_t TestPlatformScreen::AddDisplay(
102 const display::ViewportMetrics& metrics) { 102 const display::ViewportMetrics& metrics) {
103 // Generate a unique display id. 103 // Generate a unique display id.
104 int64_t display_id = display_ids_.empty() ? 1 : *display_ids_.rbegin() + 1; 104 int64_t display_id = display_ids_.empty() ? 1 : *display_ids_.rbegin() + 1;
105 display_ids_.insert(display_id); 105 display_ids_.insert(display_id);
106 106
107 delegate_->OnDisplayAdded(display_id, metrics); 107 delegate_->OnDisplayAdded(display_id, metrics);
108 108
109 // First display added will be the primary display. 109 // First display added will be the primary display.
110 if (primary_display_id_ == display::Display::kInvalidDisplayID) { 110 if (primary_display_id_ == display::kInvalidDisplayId) {
111 primary_display_id_ = display_id; 111 primary_display_id_ = display_id;
112 delegate_->OnPrimaryDisplayChanged(display_id); 112 delegate_->OnPrimaryDisplayChanged(display_id);
113 } 113 }
114 114
115 return display_id; 115 return display_id;
116 } 116 }
117 117
118 void TestPlatformScreen::ModifyDisplay( 118 void TestPlatformScreen::ModifyDisplay(
119 int64_t id, 119 int64_t id,
120 const display::ViewportMetrics& metrics) { 120 const display::ViewportMetrics& metrics) {
121 DCHECK(display_ids_.count(id) == 1); 121 DCHECK(display_ids_.count(id) == 1);
122 delegate_->OnDisplayModified(id, metrics); 122 delegate_->OnDisplayModified(id, metrics);
123 } 123 }
124 124
125 void TestPlatformScreen::RemoveDisplay(int64_t id) { 125 void TestPlatformScreen::RemoveDisplay(int64_t id) {
126 DCHECK(display_ids_.count(id) == 1); 126 DCHECK(display_ids_.count(id) == 1);
127 delegate_->OnDisplayRemoved(id); 127 delegate_->OnDisplayRemoved(id);
128 display_ids_.erase(id); 128 display_ids_.erase(id);
129 } 129 }
130 130
131 void TestPlatformScreen::Init(display::PlatformScreenDelegate* delegate) { 131 void TestPlatformScreen::Init(display::PlatformScreenDelegate* delegate) {
132 // Reset 132 // Reset
133 delegate_ = delegate; 133 delegate_ = delegate;
134 display_ids_.clear(); 134 display_ids_.clear();
135 primary_display_id_ = display::Display::kInvalidDisplayID; 135 primary_display_id_ = display::kInvalidDisplayId;
136 } 136 }
137 137
138 int64_t TestPlatformScreen::GetPrimaryDisplayId() const { 138 int64_t TestPlatformScreen::GetPrimaryDisplayId() const {
139 return primary_display_id_; 139 return primary_display_id_;
140 } 140 }
141 141
142 // TestPlatformDisplayFactory ------------------------------------------------- 142 // TestPlatformDisplayFactory -------------------------------------------------
143 143
144 TestPlatformDisplayFactory::TestPlatformDisplayFactory( 144 TestPlatformDisplayFactory::TestPlatformDisplayFactory(
145 mojom::Cursor* cursor_storage) 145 mojom::Cursor* cursor_storage)
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 return nullptr; 625 return nullptr;
626 if (!tree->AddWindow(parent_client_id, client_window_id)) 626 if (!tree->AddWindow(parent_client_id, client_window_id))
627 return nullptr; 627 return nullptr;
628 *client_id = client_window_id; 628 *client_id = client_window_id;
629 return tree->GetWindowByClientId(client_window_id); 629 return tree->GetWindowByClientId(client_window_id);
630 } 630 }
631 631
632 } // namespace test 632 } // namespace test
633 } // namespace ws 633 } // namespace ws
634 } // namespace ui 634 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/test_utils.h ('k') | services/ui/ws/user_display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698