diff options
author | dimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-28 02:37:26 +0000 |
---|---|---|
committer | dimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-28 02:37:26 +0000 |
commit | a964808db26e89221432ecb79b94221fe7bc112b (patch) | |
tree | 60bf23f453ff88dcb356d6cc805414e9c71fae54 /ui/message_center | |
parent | d5d292b379f98e13836263a41bd5c09274c9b360 (diff) | |
download | chromium_src-a964808db26e89221432ecb79b94221fe7bc112b.zip chromium_src-a964808db26e89221432ecb79b94221fe7bc112b.tar.gz chromium_src-a964808db26e89221432ecb79b94221fe7bc112b.tar.bz2 |
Rename NotificationView::ViewForNotification into NotificationView::Create
While reviewing https://codereview.chromium.org/12277024/, Steven asked if NotificationView::ViewForNotification() can return NULL. Indeed, from the name of it it is not clear if it always creates a new one or finds some view for given notification...
If we rename it to Create() for clarity (it always calls new() inside) and also to follow "static Foo::Create(...)" pattern.
Review URL: https://chromiumcodereview.appspot.com/12328159
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185121 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center')
-rw-r--r-- | ui/message_center/message_center_bubble.cc | 3 | ||||
-rw-r--r-- | ui/message_center/message_popup_bubble.cc | 3 | ||||
-rw-r--r-- | ui/message_center/message_popup_collection.cc | 3 | ||||
-rw-r--r-- | ui/message_center/notification_view.cc | 2 | ||||
-rw-r--r-- | ui/message_center/notification_view.h | 10 |
5 files changed, 9 insertions, 12 deletions
diff --git a/ui/message_center/message_center_bubble.cc b/ui/message_center/message_center_bubble.cc index 7591d9f..7883dfb 100644 --- a/ui/message_center/message_center_bubble.cc +++ b/ui/message_center/message_center_bubble.cc @@ -366,8 +366,7 @@ class MessageCenterContentsView : public views::View { size_t num_children = 0; for (NotificationList::Notifications::const_iterator iter = notifications.begin(); iter != notifications.end(); ++iter) { - MessageView* view = - NotificationView::ViewForNotification(*(*iter), list_delegate_); + MessageView* view = NotificationView::Create(*(*iter), list_delegate_); view->set_scroller(scroller_); if (IsRichNotificationEnabled()) view->SetUpShadow(); diff --git a/ui/message_center/message_popup_bubble.cc b/ui/message_center/message_popup_bubble.cc index d43001f..8b27179 100644 --- a/ui/message_center/message_popup_bubble.cc +++ b/ui/message_center/message_popup_bubble.cc @@ -59,8 +59,7 @@ void PopupBubbleContentsView::Update( for (NotificationList::PopupNotifications::const_iterator iter = popup_notifications.begin(); iter != popup_notifications.end(); ++iter) { - content_->AddChildView( - NotificationView::ViewForNotification(*(*iter), list_delegate_)); + content_->AddChildView(NotificationView::Create(*(*iter), list_delegate_)); } content_->SizeToPreferredSize(); content_->InvalidateLayout(); diff --git a/ui/message_center/message_popup_collection.cc b/ui/message_center/message_popup_collection.cc index 6625719..17b884b 100644 --- a/ui/message_center/message_popup_collection.cc +++ b/ui/message_center/message_popup_collection.cc @@ -153,8 +153,7 @@ void MessagePopupCollection::UpdatePopups() { widget = toast_iter->second->GetWidget(); old_toast_ids.erase((*iter)->id()); } else { - MessageView* view = - NotificationView::ViewForNotification(*(*iter), list_delegate_); + MessageView* view = NotificationView::Create(*(*iter), list_delegate_); view->SetUpShadow(); ToastContentsView* toast = new ToastContentsView(*iter, view, this); widget = toast->CreateWidget(context_); diff --git a/ui/message_center/notification_view.cc b/ui/message_center/notification_view.cc index db4bdad..a3ab4cc 100644 --- a/ui/message_center/notification_view.cc +++ b/ui/message_center/notification_view.cc @@ -195,7 +195,7 @@ void NotificationButton::SetTitle(const string16& title) { namespace message_center { // static -MessageView* NotificationView::ViewForNotification( +MessageView* NotificationView::Create( const Notification& notification, NotificationList::Delegate* list_delegate) { // For the time being, use MessageSimpleView for simple notifications unless diff --git a/ui/message_center/notification_view.h b/ui/message_center/notification_view.h index 833b93e..1448931 100644 --- a/ui/message_center/notification_view.h +++ b/ui/message_center/notification_view.h @@ -19,12 +19,9 @@ class NotificationView : public MessageView { // Creates appropriate MessageViews for notifications. Those currently are // always NotificationView instances but in the future may be instances of // other classes, with the class depending on the notification type. - static MessageView* ViewForNotification( - const Notification& notification, - NotificationList::Delegate* list_delegate); + static MessageView* Create(const Notification& notification, + NotificationList::Delegate* list_delegate); - NotificationView(NotificationList::Delegate* list_delegate, - const Notification& notification); virtual ~NotificationView(); // Overridden from View. @@ -36,6 +33,9 @@ class NotificationView : public MessageView { const ui::Event& event) OVERRIDE; private: + NotificationView(NotificationList::Delegate* list_delegate, + const Notification& notification); + views::View* MakeContentView(const Notification& notification); views::View* content_view_; |