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

Side by Side Diff: ui/message_center/views/custom_notification_view.cc

Issue 2897903002: [Notifications] Fix swipe to close for ARC notifications. (Closed)
Patch Set: Created 3 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
OLDNEW
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 const char* CustomNotificationView::GetClassName() const { 84 const char* CustomNotificationView::GetClassName() const {
85 return kViewClassName; 85 return kViewClassName;
86 } 86 }
87 87
88 void CustomNotificationView::UpdateControlButtonsVisibility() { 88 void CustomNotificationView::UpdateControlButtonsVisibility() {
89 if (contents_view_delegate_) 89 if (contents_view_delegate_)
90 contents_view_delegate_->UpdateControlButtonsVisibility(); 90 contents_view_delegate_->UpdateControlButtonsVisibility();
91 } 91 }
92 92
93 void CustomNotificationView::OnSlideChanged() {
94 if (contents_view_delegate_)
95 contents_view_delegate_->OnSlideChanged();
96 }
97
93 gfx::Size CustomNotificationView::GetPreferredSize() const { 98 gfx::Size CustomNotificationView::GetPreferredSize() const {
94 const gfx::Insets insets = GetInsets(); 99 const gfx::Insets insets = GetInsets();
95 const int contents_width = kNotificationWidth - insets.width(); 100 const int contents_width = kNotificationWidth - insets.width();
96 const int contents_height = contents_view_->GetHeightForWidth(contents_width); 101 const int contents_height = contents_view_->GetHeightForWidth(contents_width);
97 return gfx::Size(kNotificationWidth, contents_height + insets.height()); 102 return gfx::Size(kNotificationWidth, contents_height + insets.height());
98 } 103 }
99 104
100 void CustomNotificationView::Layout() { 105 void CustomNotificationView::Layout() {
101 MessageView::Layout(); 106 MessageView::Layout();
102 107
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 163
159 bool CustomNotificationView::OnMousePressed(const ui::MouseEvent& event) { 164 bool CustomNotificationView::OnMousePressed(const ui::MouseEvent& event) {
160 // TODO(yhanada): This hack will be removed when HandleAccessibleAction will 165 // TODO(yhanada): This hack will be removed when HandleAccessibleAction will
161 // be used for handling click events. 166 // be used for handling click events.
162 if (contents_view_ && contents_view_->OnMousePressed(event)) 167 if (contents_view_ && contents_view_->OnMousePressed(event))
163 return true; 168 return true;
164 return MessageView::OnMousePressed(event); 169 return MessageView::OnMousePressed(event);
165 } 170 }
166 171
167 } // namespace message_center 172 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/views/custom_notification_view.h ('k') | ui/message_center/views/custom_notification_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698