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 "ui/message_center/views/custom_notification_view.h" | 5 #include "ui/message_center/views/custom_notification_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ui/base/ime/input_method.h" | 9 #include "ui/base/ime/input_method.h" |
10 #include "ui/base/ime/text_input_client.h" | 10 #include "ui/base/ime/text_input_client.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 if (!contents_view_delegate_) | 68 if (!contents_view_delegate_) |
69 return false; | 69 return false; |
70 return contents_view_delegate_->IsCloseButtonFocused(); | 70 return contents_view_delegate_->IsCloseButtonFocused(); |
71 } | 71 } |
72 | 72 |
73 void CustomNotificationView::RequestFocusOnCloseButton() { | 73 void CustomNotificationView::RequestFocusOnCloseButton() { |
74 if (contents_view_delegate_) | 74 if (contents_view_delegate_) |
75 contents_view_delegate_->RequestFocusOnCloseButton(); | 75 contents_view_delegate_->RequestFocusOnCloseButton(); |
76 } | 76 } |
77 | 77 |
78 bool CustomNotificationView::IsPinned() const { | |
79 if (!contents_view_delegate_) | |
80 return false; | |
81 return contents_view_delegate_->IsPinned(); | |
82 } | |
83 | |
84 const char* CustomNotificationView::GetClassName() const { | 78 const char* CustomNotificationView::GetClassName() const { |
85 return kViewClassName; | 79 return kViewClassName; |
86 } | 80 } |
87 | 81 |
88 void CustomNotificationView::UpdateControlButtonsVisibility() { | 82 void CustomNotificationView::UpdateControlButtonsVisibility() { |
89 if (contents_view_delegate_) | 83 if (contents_view_delegate_) |
90 contents_view_delegate_->UpdateControlButtonsVisibility(); | 84 contents_view_delegate_->UpdateControlButtonsVisibility(); |
91 } | 85 } |
92 | 86 |
93 gfx::Size CustomNotificationView::GetPreferredSize() const { | 87 gfx::Size CustomNotificationView::GetPreferredSize() const { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 152 |
159 bool CustomNotificationView::OnMousePressed(const ui::MouseEvent& event) { | 153 bool CustomNotificationView::OnMousePressed(const ui::MouseEvent& event) { |
160 // TODO(yhanada): This hack will be removed when HandleAccessibleAction will | 154 // TODO(yhanada): This hack will be removed when HandleAccessibleAction will |
161 // be used for handling click events. | 155 // be used for handling click events. |
162 if (contents_view_ && contents_view_->OnMousePressed(event)) | 156 if (contents_view_ && contents_view_->OnMousePressed(event)) |
163 return true; | 157 return true; |
164 return MessageView::OnMousePressed(event); | 158 return MessageView::OnMousePressed(event); |
165 } | 159 } |
166 | 160 |
167 } // namespace message_center | 161 } // namespace message_center |
OLD | NEW |