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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/widget/desktop_aura/desktop_native_widget_aura.h" 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 void DesktopNativeWidgetAura::SetBounds(const gfx::Rect& bounds) { 689 void DesktopNativeWidgetAura::SetBounds(const gfx::Rect& bounds) {
690 if (!content_window_) 690 if (!content_window_)
691 return; 691 return;
692 // TODO(ananta) 692 // TODO(ananta)
693 // This code by default scales the bounds rectangle by 1. 693 // This code by default scales the bounds rectangle by 1.
694 // We could probably get rid of this and similar logic from 694 // We could probably get rid of this and similar logic from
695 // the DesktopNativeWidgetAura::OnWindowTreeHostResized function. 695 // the DesktopNativeWidgetAura::OnWindowTreeHostResized function.
696 float scale = 1; 696 float scale = 1;
697 aura::Window* root = host_->window(); 697 aura::Window* root = host_->window();
698 if (root) { 698 if (root) {
699 scale = gfx::Screen::GetScreenFor(root)-> 699 scale = gfx::Screen::GetScreen()
700 GetDisplayNearestWindow(root).device_scale_factor(); 700 ->GetDisplayNearestWindow(root)
701 .device_scale_factor();
701 } 702 }
702 gfx::Rect bounds_in_pixels = 703 gfx::Rect bounds_in_pixels =
703 gfx::ScaleToEnclosingRect(bounds, scale, scale); 704 gfx::ScaleToEnclosingRect(bounds, scale, scale);
704 desktop_window_tree_host_->AsWindowTreeHost()->SetBounds(bounds_in_pixels); 705 desktop_window_tree_host_->AsWindowTreeHost()->SetBounds(bounds_in_pixels);
705 } 706 }
706 707
707 void DesktopNativeWidgetAura::SetSize(const gfx::Size& size) { 708 void DesktopNativeWidgetAura::SetSize(const gfx::Size& size) {
708 if (content_window_) 709 if (content_window_)
709 desktop_window_tree_host_->SetSize(size); 710 desktop_window_tree_host_->SetSize(size);
710 } 711 }
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 if (cursor_reference_count_ == 0) { 1207 if (cursor_reference_count_ == 0) {
1207 // We are the last DesktopNativeWidgetAura instance, and we are responsible 1208 // We are the last DesktopNativeWidgetAura instance, and we are responsible
1208 // for cleaning up |cursor_manager_|. 1209 // for cleaning up |cursor_manager_|.
1209 delete cursor_manager_; 1210 delete cursor_manager_;
1210 native_cursor_manager_ = NULL; 1211 native_cursor_manager_ = NULL;
1211 cursor_manager_ = NULL; 1212 cursor_manager_ = NULL;
1212 } 1213 }
1213 } 1214 }
1214 1215
1215 } // namespace views 1216 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698