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

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

Issue 2960333003: Extract the view of control buttons on notification into a separated class (Closed)
Patch Set: addressed comments Created 3 years, 5 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
« no previous file with comments | « ui/message_center/views/notification_control_buttons_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/message_center/views/notification_control_buttons_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698