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

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

Issue 23636010: Notifications: Add cross-platform UMA: ShowMessageCenter, ShowSettings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added the hash to chromeactions.txt Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « ui/message_center/message_center_types.h ('k') | ui/message_center/views/message_view.cc » ('j') | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/message_center_view.h" 5 #include "ui/message_center/views/message_center_view.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "grit/ui_strings.h" 13 #include "grit/ui_strings.h"
14 #include "ui/base/animation/multi_animation.h" 14 #include "ui/base/animation/multi_animation.h"
15 #include "ui/base/animation/slide_animation.h" 15 #include "ui/base/animation/slide_animation.h"
16 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
17 #include "ui/gfx/canvas.h" 17 #include "ui/gfx/canvas.h"
18 #include "ui/gfx/insets.h" 18 #include "ui/gfx/insets.h"
19 #include "ui/gfx/rect.h" 19 #include "ui/gfx/rect.h"
20 #include "ui/gfx/size.h" 20 #include "ui/gfx/size.h"
21 #include "ui/message_center/message_center.h" 21 #include "ui/message_center/message_center.h"
22 #include "ui/message_center/message_center_style.h" 22 #include "ui/message_center/message_center_style.h"
23 #include "ui/message_center/message_center_types.h"
23 #include "ui/message_center/views/message_center_button_bar.h" 24 #include "ui/message_center/views/message_center_button_bar.h"
24 #include "ui/message_center/views/message_view.h" 25 #include "ui/message_center/views/message_view.h"
25 #include "ui/message_center/views/notification_view.h" 26 #include "ui/message_center/views/notification_view.h"
26 #include "ui/message_center/views/notifier_settings_view.h" 27 #include "ui/message_center/views/notifier_settings_view.h"
27 #include "ui/views/animation/bounds_animator.h" 28 #include "ui/views/animation/bounds_animator.h"
28 #include "ui/views/animation/bounds_animator_observer.h" 29 #include "ui/views/animation/bounds_animator_observer.h"
29 #include "ui/views/background.h" 30 #include "ui/views/background.h"
30 #include "ui/views/border.h" 31 #include "ui/views/border.h"
31 #include "ui/views/controls/button/button.h" 32 #include "ui/views/controls/button/button.h"
32 #include "ui/views/controls/label.h" 33 #include "ui/views/controls/label.h"
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 message_views_[index] = view; 928 message_views_[index] = view;
928 NotificationsChanged(); 929 NotificationsChanged();
929 break; 930 break;
930 } 931 }
931 } 932 }
932 } 933 }
933 934
934 void MessageCenterView::AnimationEnded(const ui::Animation* animation) { 935 void MessageCenterView::AnimationEnded(const ui::Animation* animation) {
935 DCHECK_EQ(animation, settings_transition_animation_.get()); 936 DCHECK_EQ(animation, settings_transition_animation_.get());
936 937
938 Visibility visibility = target_view_ == settings_view_
939 ? VISIBILITY_SETTINGS
940 : VISIBILITY_MESSAGE_CENTER;
941 message_center_->SetVisibility(visibility);
942
937 source_view_->SetVisible(false); 943 source_view_->SetVisible(false);
938 target_view_->SetVisible(true); 944 target_view_->SetVisible(true);
939 if (source_view_->layer()) 945 if (source_view_->layer())
940 source_view_->layer()->SetOpacity(1.0); 946 source_view_->layer()->SetOpacity(1.0);
941 if (target_view_->layer()) 947 if (target_view_->layer())
942 target_view_->layer()->SetOpacity(1.0); 948 target_view_->layer()->SetOpacity(1.0);
943 settings_transition_animation_.reset(); 949 settings_transition_animation_.reset();
944 PreferredSizeChanged(); 950 PreferredSizeChanged();
945 Layout(); 951 Layout();
946 } 952 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 scroller_->InvalidateLayout(); 999 scroller_->InvalidateLayout();
994 PreferredSizeChanged(); 1000 PreferredSizeChanged();
995 Layout(); 1001 Layout();
996 } 1002 }
997 1003
998 void MessageCenterView::SetNotificationViewForTest(views::View* view) { 1004 void MessageCenterView::SetNotificationViewForTest(views::View* view) {
999 message_list_view_->AddNotificationAt(view, 0); 1005 message_list_view_->AddNotificationAt(view, 0);
1000 } 1006 }
1001 1007
1002 } // namespace message_center 1008 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/message_center_types.h ('k') | ui/message_center/views/message_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698