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

Side by Side Diff: ui/views/widget/widget_interactive_uitest.cc

Issue 2524873002: Rename WindowTreeHost G|SetBounds to indicate they are in pixels. (Closed)
Patch Set: rebase Created 4 years 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) 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 HWND hwnd = host->GetAcceleratedWidget(); 792 HWND hwnd = host->GetAcceleratedWidget();
793 793
794 HMONITOR monitor = ::MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST); 794 HMONITOR monitor = ::MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
795 ASSERT_TRUE(!!monitor); 795 ASSERT_TRUE(!!monitor);
796 MONITORINFO monitor_info; 796 MONITORINFO monitor_info;
797 monitor_info.cbSize = sizeof(monitor_info); 797 monitor_info.cbSize = sizeof(monitor_info);
798 ASSERT_TRUE(::GetMonitorInfo(monitor, &monitor_info)); 798 ASSERT_TRUE(::GetMonitorInfo(monitor, &monitor_info));
799 799
800 gfx::Rect monitor_bounds(monitor_info.rcMonitor); 800 gfx::Rect monitor_bounds(monitor_info.rcMonitor);
801 gfx::Rect window_bounds = widget.GetWindowBoundsInScreen(); 801 gfx::Rect window_bounds = widget.GetWindowBoundsInScreen();
802 gfx::Rect client_area_bounds = host->GetBounds(); 802 gfx::Rect client_area_bounds = host->GetBoundsInPixels();
803 803
804 EXPECT_EQ(window_bounds, monitor_bounds); 804 EXPECT_EQ(window_bounds, monitor_bounds);
805 EXPECT_EQ(monitor_bounds, client_area_bounds); 805 EXPECT_EQ(monitor_bounds, client_area_bounds);
806 806
807 // Setting not fullscreen should return it to maximized. 807 // Setting not fullscreen should return it to maximized.
808 widget.SetFullscreen(false); 808 widget.SetFullscreen(false);
809 EXPECT_FALSE(widget.IsFullscreen()); 809 EXPECT_FALSE(widget.IsFullscreen());
810 EXPECT_TRUE(widget.IsMaximized()); 810 EXPECT_TRUE(widget.IsMaximized());
811 811
812 client_area_bounds = host->GetBounds(); 812 client_area_bounds = host->GetBoundsInPixels();
813 EXPECT_TRUE(monitor_bounds.Contains(client_area_bounds)); 813 EXPECT_TRUE(monitor_bounds.Contains(client_area_bounds));
814 EXPECT_NE(monitor_bounds, client_area_bounds); 814 EXPECT_NE(monitor_bounds, client_area_bounds);
815 815
816 widget.CloseNow(); 816 widget.CloseNow();
817 } 817 }
818 #endif // defined(OS_WIN) 818 #endif // defined(OS_WIN)
819 819
820 #if !defined(OS_CHROMEOS) 820 #if !defined(OS_CHROMEOS)
821 // Provides functionality to create a window modal dialog. 821 // Provides functionality to create a window modal dialog.
822 class ModalDialogDelegate : public DialogDelegateView { 822 class ModalDialogDelegate : public DialogDelegateView {
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1822 1822
1823 ui::KeyEvent key_event2(key_event); 1823 ui::KeyEvent key_event2(key_event);
1824 widget->OnKeyEvent(&key_event2); 1824 widget->OnKeyEvent(&key_event2);
1825 EXPECT_FALSE(key_event2.stopped_propagation()); 1825 EXPECT_FALSE(key_event2.stopped_propagation());
1826 1826
1827 widget->CloseNow(); 1827 widget->CloseNow();
1828 } 1828 }
1829 1829
1830 } // namespace test 1830 } // namespace test
1831 } // namespace views 1831 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_aura_unittest.cc ('k') | ui/wm/core/capture_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698