| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/notification_view.h" | 5 #include "ui/message_center/views/notification_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 std::string id(notification_id()); | 381 std::string id(notification_id()); |
| 382 | 382 |
| 383 if (close_button_ && sender == close_button_.get()) { | 383 if (close_button_ && sender == close_button_.get()) { |
| 384 // Warning: This causes the NotificationView itself to be deleted, so don't | 384 // Warning: This causes the NotificationView itself to be deleted, so don't |
| 385 // do anything afterwards. | 385 // do anything afterwards. |
| 386 OnCloseButtonPressed(); | 386 OnCloseButtonPressed(); |
| 387 return; | 387 return; |
| 388 } | 388 } |
| 389 | 389 |
| 390 if (sender == settings_button_view_) { | 390 if (sender == settings_button_view_) { |
| 391 controller()->ClickOnSettingsButton(id); | 391 OnSettingsButtonPressed(); |
| 392 return; | 392 return; |
| 393 } | 393 } |
| 394 | 394 |
| 395 // See if the button pressed was an action button. | 395 // See if the button pressed was an action button. |
| 396 for (size_t i = 0; i < action_buttons_.size(); ++i) { | 396 for (size_t i = 0; i < action_buttons_.size(); ++i) { |
| 397 if (sender == action_buttons_[i]) { | 397 if (sender == action_buttons_[i]) { |
| 398 controller()->ClickOnNotificationButton(id, i); | 398 controller()->ClickOnNotificationButton(id, i); |
| 399 return; | 399 return; |
| 400 } | 400 } |
| 401 } | 401 } |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 | 772 |
| 773 return message_line_limit; | 773 return message_line_limit; |
| 774 } | 774 } |
| 775 | 775 |
| 776 int NotificationView::GetMessageHeight(int width, int limit) const { | 776 int NotificationView::GetMessageHeight(int width, int limit) const { |
| 777 return message_view_ ? | 777 return message_view_ ? |
| 778 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; | 778 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; |
| 779 } | 779 } |
| 780 | 780 |
| 781 } // namespace message_center | 781 } // namespace message_center |
| OLD | NEW |