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

Side by Side Diff: ui/aura/window_tree_host.cc

Issue 2345283002: aura: Allow platform to choose how it retrieves ICCProfile. (Closed)
Patch Set: . 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 | « ui/aura/window_tree_host.h ('k') | ui/views/mus/window_tree_host_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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/aura/window_tree_host.h" 5 #include "ui/aura/window_tree_host.h"
6 6
7 #include "base/threading/thread_task_runner_handle.h" 7 #include "base/threading/thread_task_runner_handle.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "ui/aura/client/capture_client.h" 9 #include "ui/aura/client/capture_client.h"
10 #include "ui/aura/client/cursor_client.h" 10 #include "ui/aura/client/cursor_client.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 InitCompositor(); 62 InitCompositor();
63 UpdateRootWindowSize(GetBounds().size()); 63 UpdateRootWindowSize(GetBounds().size());
64 Env::GetInstance()->NotifyHostInitialized(this); 64 Env::GetInstance()->NotifyHostInitialized(this);
65 window()->Show(); 65 window()->Show();
66 } 66 }
67 67
68 void WindowTreeHost::InitCompositor() { 68 void WindowTreeHost::InitCompositor() {
69 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), 69 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()),
70 GetBounds().size()); 70 GetBounds().size());
71 compositor_->SetRootLayer(window()->layer()); 71 compositor_->SetRootLayer(window()->layer());
72
73 // TODO(hubbe): Get the color space from the *current* monitor and
74 // update it when window is moved or color space configuration changes.
75 compositor_->SetDisplayColorSpace( 72 compositor_->SetDisplayColorSpace(
76 gfx::ICCProfile::FromBestMonitor().GetColorSpace()); 73 GetICCProfileForCurrentDisplay().GetColorSpace());
77 } 74 }
78 75
79 void WindowTreeHost::AddObserver(WindowTreeHostObserver* observer) { 76 void WindowTreeHost::AddObserver(WindowTreeHostObserver* observer) {
80 observers_.AddObserver(observer); 77 observers_.AddObserver(observer);
81 } 78 }
82 79
83 void WindowTreeHost::RemoveObserver(WindowTreeHostObserver* observer) { 80 void WindowTreeHost::RemoveObserver(WindowTreeHostObserver* observer) {
84 observers_.RemoveObserver(observer); 81 observers_.RemoveObserver(observer);
85 } 82 }
86 83
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 void WindowTreeHost::OnHostActivated() { 303 void WindowTreeHost::OnHostActivated() {
307 Env::GetInstance()->NotifyHostActivated(this); 304 Env::GetInstance()->NotifyHostActivated(this);
308 } 305 }
309 306
310 void WindowTreeHost::OnHostLostWindowCapture() { 307 void WindowTreeHost::OnHostLostWindowCapture() {
311 Window* capture_window = client::GetCaptureWindow(window()); 308 Window* capture_window = client::GetCaptureWindow(window());
312 if (capture_window && capture_window->GetRootWindow() == window()) 309 if (capture_window && capture_window->GetRootWindow() == window())
313 capture_window->ReleaseCapture(); 310 capture_window->ReleaseCapture();
314 } 311 }
315 312
313 gfx::ICCProfile WindowTreeHost::GetICCProfileForCurrentDisplay() {
314 // TODO(hubbe): Get the color space from the *current* monitor and
315 // update it when window is moved or color space configuration changes.
316 return gfx::ICCProfile::FromBestMonitor();
317 }
318
316 ui::EventProcessor* WindowTreeHost::GetEventProcessor() { 319 ui::EventProcessor* WindowTreeHost::GetEventProcessor() {
317 return event_processor(); 320 return event_processor();
318 } 321 }
319 322
320 //////////////////////////////////////////////////////////////////////////////// 323 ////////////////////////////////////////////////////////////////////////////////
321 // WindowTreeHost, private: 324 // WindowTreeHost, private:
322 325
323 void WindowTreeHost::MoveCursorToInternal(const gfx::Point& root_location, 326 void WindowTreeHost::MoveCursorToInternal(const gfx::Point& root_location,
324 const gfx::Point& host_location) { 327 const gfx::Point& host_location) {
325 last_cursor_request_position_in_host_ = host_location; 328 last_cursor_request_position_in_host_ = host_location;
326 MoveCursorToNative(host_location); 329 MoveCursorToNative(host_location);
327 client::CursorClient* cursor_client = client::GetCursorClient(window()); 330 client::CursorClient* cursor_client = client::GetCursorClient(window());
328 if (cursor_client) { 331 if (cursor_client) {
329 const display::Display& display = 332 const display::Display& display =
330 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); 333 display::Screen::GetScreen()->GetDisplayNearestWindow(window());
331 cursor_client->SetDisplay(display); 334 cursor_client->SetDisplay(display);
332 } 335 }
333 dispatcher()->OnCursorMovedToRootLocation(root_location); 336 dispatcher()->OnCursorMovedToRootLocation(root_location);
334 } 337 }
335 338
336 } // namespace aura 339 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window_tree_host.h ('k') | ui/views/mus/window_tree_host_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698