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

Side by Side Diff: ui/views/window/dialog_delegate_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
« no previous file with comments | « ui/views/window/dialog_client_view.cc ('k') | ui/views/window/native_frame_view.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 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 "base/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "ui/base/hit_test.h" 6 #include "ui/base/hit_test.h"
7 #include "ui/views/bubble/bubble_border.h" 7 #include "ui/views/bubble/bubble_border.h"
8 #include "ui/views/bubble/bubble_frame_view.h" 8 #include "ui/views/bubble/bubble_frame_view.h"
9 #include "ui/views/controls/button/checkbox.h" 9 #include "ui/views/controls/button/checkbox.h"
10 #include "ui/views/controls/button/label_button.h" 10 #include "ui/views/controls/button/label_button.h"
(...skipping 19 matching lines...) Expand all
30 virtual bool Cancel() OVERRIDE { 30 virtual bool Cancel() OVERRIDE {
31 canceled_ = true; 31 canceled_ = true;
32 return closeable_; 32 return closeable_;
33 } 33 }
34 virtual bool Accept() OVERRIDE { 34 virtual bool Accept() OVERRIDE {
35 accepted_ = true; 35 accepted_ = true;
36 return closeable_; 36 return closeable_;
37 } 37 }
38 38
39 // DialogDelegateView overrides: 39 // DialogDelegateView overrides:
40 virtual gfx::Size GetPreferredSize() OVERRIDE { return gfx::Size(200, 200); } 40 virtual gfx::Size GetPreferredSize() const OVERRIDE {
41 return gfx::Size(200, 200);
42 }
41 virtual base::string16 GetWindowTitle() const OVERRIDE { return title_; } 43 virtual base::string16 GetWindowTitle() const OVERRIDE { return title_; }
42 44
43 // ButtonListener override: 45 // ButtonListener override:
44 virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE { 46 virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE {
45 last_pressed_button_ = sender; 47 last_pressed_button_ = sender;
46 } 48 }
47 49
48 Button* last_pressed_button() const { return last_pressed_button_; } 50 Button* last_pressed_button() const { return last_pressed_button_; }
49 51
50 void PressEnterAndCheckStates(Button* button) { 52 void PressEnterAndCheckStates(Button* button) {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 frame2->GetPreferredSize().height()); 219 frame2->GetPreferredSize().height());
218 220
219 // Giving the default test dialog a title will yield the same bounds. 221 // Giving the default test dialog a title will yield the same bounds.
220 dialog()->set_title(base::ASCIIToUTF16("Title")); 222 dialog()->set_title(base::ASCIIToUTF16("Title"));
221 dialog()->GetWidget()->UpdateWindowTitle(); 223 dialog()->GetWidget()->UpdateWindowTitle();
222 EXPECT_EQ(frame1->GetPreferredSize().height(), 224 EXPECT_EQ(frame1->GetPreferredSize().height(),
223 frame2->GetPreferredSize().height()); 225 frame2->GetPreferredSize().height());
224 } 226 }
225 227
226 } // namespace views 228 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/window/dialog_client_view.cc ('k') | ui/views/window/native_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698