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

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

Issue 2873553002: [Notifications] Fix swipe to close for ARC notifications. (Closed)
Patch Set: Address comments. 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 const char* CustomNotificationView::GetClassName() const { 78 const char* CustomNotificationView::GetClassName() const {
79 return kViewClassName; 79 return kViewClassName;
80 } 80 }
81 81
82 void CustomNotificationView::UpdateControlButtonsVisibility() { 82 void CustomNotificationView::UpdateControlButtonsVisibility() {
83 if (contents_view_delegate_) 83 if (contents_view_delegate_)
84 contents_view_delegate_->UpdateControlButtonsVisibility(); 84 contents_view_delegate_->UpdateControlButtonsVisibility();
85 } 85 }
86 86
87 void CustomNotificationView::OnSlideChanged() {
88 if (contents_view_delegate_)
89 contents_view_delegate_->OnSlideChanged();
90 }
91
87 gfx::Size CustomNotificationView::GetPreferredSize() const { 92 gfx::Size CustomNotificationView::GetPreferredSize() const {
88 const gfx::Insets insets = GetInsets(); 93 const gfx::Insets insets = GetInsets();
89 const int contents_width = kNotificationWidth - insets.width(); 94 const int contents_width = kNotificationWidth - insets.width();
90 const int contents_height = contents_view_->GetHeightForWidth(contents_width); 95 const int contents_height = contents_view_->GetHeightForWidth(contents_width);
91 return gfx::Size(kNotificationWidth, contents_height + insets.height()); 96 return gfx::Size(kNotificationWidth, contents_height + insets.height());
92 } 97 }
93 98
94 void CustomNotificationView::Layout() { 99 void CustomNotificationView::Layout() {
95 MessageView::Layout(); 100 MessageView::Layout();
96 101
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 156 }
152 157
153 bool CustomNotificationView::HandleAccessibleAction( 158 bool CustomNotificationView::HandleAccessibleAction(
154 const ui::AXActionData& action) { 159 const ui::AXActionData& action) {
155 if (contents_view_) 160 if (contents_view_)
156 return contents_view_->HandleAccessibleAction(action); 161 return contents_view_->HandleAccessibleAction(action);
157 return false; 162 return false;
158 } 163 }
159 164
160 } // namespace message_center 165 } // 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