| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 void NotificationView::ButtonPressed(views::Button* sender, | 342 void NotificationView::ButtonPressed(views::Button* sender, |
| 343 const ui::Event& event) { | 343 const ui::Event& event) { |
| 344 // Certain operations can cause |this| to be destructed, so copy the members | 344 // Certain operations can cause |this| to be destructed, so copy the members |
| 345 // we send to other parts of the code. | 345 // we send to other parts of the code. |
| 346 // TODO(dewittj): Remove this hack. | 346 // TODO(dewittj): Remove this hack. |
| 347 std::string id(notification_id()); | 347 std::string id(notification_id()); |
| 348 | 348 |
| 349 if (close_button_ && sender == close_button_.get()) { | 349 if (close_button_ && sender == close_button_.get()) { |
| 350 // Warning: This causes the NotificationView itself to be deleted, so don't | 350 // Warning: This causes the NotificationView itself to be deleted, so don't |
| 351 // do anything afterwards. | 351 // do anything afterwards. |
| 352 controller()->RemoveNotification(id, true /* by_user */); | 352 OnCloseButtonPressed(); |
| 353 return; | 353 return; |
| 354 } | 354 } |
| 355 | 355 |
| 356 if (sender == settings_button_view_) { | 356 if (sender == settings_button_view_) { |
| 357 controller()->ClickOnSettingsButton(id); | 357 controller()->ClickOnSettingsButton(id); |
| 358 return; | 358 return; |
| 359 } | 359 } |
| 360 | 360 |
| 361 // See if the button pressed was an action button. | 361 // See if the button pressed was an action button. |
| 362 for (size_t i = 0; i < action_buttons_.size(); ++i) { | 362 for (size_t i = 0; i < action_buttons_.size(); ++i) { |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 | 720 |
| 721 return message_line_limit; | 721 return message_line_limit; |
| 722 } | 722 } |
| 723 | 723 |
| 724 int NotificationView::GetMessageHeight(int width, int limit) const { | 724 int NotificationView::GetMessageHeight(int width, int limit) const { |
| 725 return message_view_ ? | 725 return message_view_ ? |
| 726 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; | 726 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; |
| 727 } | 727 } |
| 728 | 728 |
| 729 } // namespace message_center | 729 } // namespace message_center |
| OLD | NEW |