| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |