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

Side by Side Diff: ash/wm/system_modal_container_layout_manager_unittest.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 6 years, 7 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 | Annotate | Revision Log
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 "ash/wm/system_modal_container_layout_manager.h" 5 #include "ash/wm/system_modal_container_layout_manager.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/session/session_state_delegate.h" 8 #include "ash/session/session_state_delegate.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 explicit TestWindow(bool modal) : modal_(modal) {} 66 explicit TestWindow(bool modal) : modal_(modal) {}
67 virtual ~TestWindow() {} 67 virtual ~TestWindow() {}
68 68
69 // The window needs be closed from widget in order for 69 // The window needs be closed from widget in order for
70 // aura::client::kModalKey property to be reset. 70 // aura::client::kModalKey property to be reset.
71 static void CloseTestWindow(aura::Window* window) { 71 static void CloseTestWindow(aura::Window* window) {
72 views::Widget::GetWidgetForNativeWindow(window)->Close(); 72 views::Widget::GetWidgetForNativeWindow(window)->Close();
73 } 73 }
74 74
75 // Overridden from views::View: 75 // Overridden from views::View:
76 virtual gfx::Size GetPreferredSize() OVERRIDE { 76 virtual gfx::Size GetPreferredSize() const OVERRIDE {
77 return gfx::Size(50, 50); 77 return gfx::Size(50, 50);
78 } 78 }
79 79
80 // Overridden from views::WidgetDelegate: 80 // Overridden from views::WidgetDelegate:
81 virtual views::View* GetContentsView() OVERRIDE { 81 virtual views::View* GetContentsView() OVERRIDE {
82 return this; 82 return this;
83 } 83 }
84 virtual ui::ModalType GetModalType() const OVERRIDE { 84 virtual ui::ModalType GetModalType() const OVERRIDE {
85 return modal_ ? ui::MODAL_TYPE_SYSTEM : ui::MODAL_TYPE_NONE; 85 return modal_ ? ui::MODAL_TYPE_SYSTEM : ui::MODAL_TYPE_NONE;
86 } 86 }
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 587
588 // After the keyboard is gone, the window will remain where it was. 588 // After the keyboard is gone, the window will remain where it was.
589 ShowKeyboard(false); 589 ShowKeyboard(false);
590 EXPECT_NE(modal_bounds.ToString(), modal_window->bounds().ToString()); 590 EXPECT_NE(modal_bounds.ToString(), modal_window->bounds().ToString());
591 EXPECT_EQ(modal_size.ToString(), modal_window->bounds().size().ToString()); 591 EXPECT_EQ(modal_size.ToString(), modal_window->bounds().size().ToString());
592 EXPECT_EQ(modal_origin.x(), modal_window->bounds().x()); 592 EXPECT_EQ(modal_origin.x(), modal_window->bounds().x());
593 } 593 }
594 594
595 } // namespace test 595 } // namespace test
596 } // namespace ash 596 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698