OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 int keyboard_event_count_ = 0; | 84 int keyboard_event_count_ = 0; |
85 gfx::Size preferred_size_ = gfx::Size(100, 100); | 85 gfx::Size preferred_size_ = gfx::Size(100, 100); |
86 | 86 |
87 DISALLOW_COPY_AND_ASSIGN(TestCustomView); | 87 DISALLOW_COPY_AND_ASSIGN(TestCustomView); |
88 }; | 88 }; |
89 | 89 |
90 class TestContentViewDelegate : public CustomNotificationContentViewDelegate { | 90 class TestContentViewDelegate : public CustomNotificationContentViewDelegate { |
91 public: | 91 public: |
92 bool IsCloseButtonFocused() const override { return false; } | 92 bool IsCloseButtonFocused() const override { return false; } |
93 void RequestFocusOnCloseButton() override {} | 93 void RequestFocusOnCloseButton() override {} |
94 bool IsPinned() const override { return false; } | |
95 void UpdateControlButtonsVisibility() override {} | 94 void UpdateControlButtonsVisibility() override {} |
96 }; | 95 }; |
97 | 96 |
98 class TestNotificationDelegate : public NotificationDelegate { | 97 class TestNotificationDelegate : public NotificationDelegate { |
99 public: | 98 public: |
100 TestNotificationDelegate() {} | 99 TestNotificationDelegate() {} |
101 | 100 |
102 // NotificateDelegate | 101 // NotificateDelegate |
103 std::unique_ptr<CustomContent> CreateCustomContent() override { | 102 std::unique_ptr<CustomContent> CreateCustomContent() override { |
104 return base::MakeUnique<CustomContent>( | 103 return base::MakeUnique<CustomContent>( |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 EXPECT_EQ("360x10", size.ToString()); | 390 EXPECT_EQ("360x10", size.ToString()); |
392 | 391 |
393 // The long notification. | 392 // The long notification. |
394 custom_view()->set_preferred_size(gfx::Size(1000, 1000)); | 393 custom_view()->set_preferred_size(gfx::Size(1000, 1000)); |
395 size = notification_view()->GetPreferredSize(); | 394 size = notification_view()->GetPreferredSize(); |
396 size.Enlarge(0, -notification_view()->GetInsets().height()); | 395 size.Enlarge(0, -notification_view()->GetInsets().height()); |
397 EXPECT_EQ("360x1000", size.ToString()); | 396 EXPECT_EQ("360x1000", size.ToString()); |
398 } | 397 } |
399 | 398 |
400 } // namespace message_center | 399 } // namespace message_center |
OLD | NEW |