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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view_layout_unittest.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/browser/ui/views/frame/browser_view_layout.h" 5 #include "chrome/browser/ui/views/frame/browser_view_layout.h"
6 6
7 #include "chrome/browser/ui/views/frame/browser_view.h" 7 #include "chrome/browser/ui/views/frame/browser_view.h"
8 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" 8 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h"
9 #include "chrome/browser/ui/views/frame/contents_layout_manager.h" 9 #include "chrome/browser/ui/views/frame/contents_layout_manager.h"
10 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" 10 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 // A simple view that prefers an initial size. 82 // A simple view that prefers an initial size.
83 class MockView : public views::View { 83 class MockView : public views::View {
84 public: 84 public:
85 explicit MockView(gfx::Size initial_size) 85 explicit MockView(gfx::Size initial_size)
86 : size_(initial_size) { 86 : size_(initial_size) {
87 SetBoundsRect(gfx::Rect(gfx::Point(), size_)); 87 SetBoundsRect(gfx::Rect(gfx::Point(), size_));
88 } 88 }
89 virtual ~MockView() {} 89 virtual ~MockView() {}
90 90
91 // views::View overrides: 91 // views::View overrides:
92 virtual gfx::Size GetPreferredSize() OVERRIDE { 92 virtual gfx::Size GetPreferredSize() const OVERRIDE {
93 return size_; 93 return size_;
94 } 94 }
95 95
96 private: 96 private:
97 gfx::Size size_; 97 gfx::Size size_;
98 98
99 DISALLOW_COPY_AND_ASSIGN(MockView); 99 DISALLOW_COPY_AND_ASSIGN(MockView);
100 }; 100 };
101 101
102 /////////////////////////////////////////////////////////////////////////////// 102 ///////////////////////////////////////////////////////////////////////////////
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 const int kBottom = 500; 258 const int kBottom = 500;
259 EXPECT_EQ(kBottom, layout()->LayoutDownloadShelf(kBottom)); 259 EXPECT_EQ(kBottom, layout()->LayoutDownloadShelf(kBottom));
260 260
261 // Download shelf layout moves up the bottom edge and sets visibility. 261 // Download shelf layout moves up the bottom edge and sets visibility.
262 delegate()->set_download_shelf_needs_layout(true); 262 delegate()->set_download_shelf_needs_layout(true);
263 download_shelf->SetVisible(false); 263 download_shelf->SetVisible(false);
264 EXPECT_EQ(450, layout()->LayoutDownloadShelf(kBottom)); 264 EXPECT_EQ(450, layout()->LayoutDownloadShelf(kBottom));
265 EXPECT_TRUE(download_shelf->visible()); 265 EXPECT_TRUE(download_shelf->visible());
266 EXPECT_EQ("0,450 0x50", download_shelf->bounds().ToString()); 266 EXPECT_EQ("0,450 0x50", download_shelf->bounds().ToString());
267 } 267 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_layout.cc ('k') | chrome/browser/ui/views/frame/contents_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698