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

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

Issue 18247002: Remove the most obvious dead code from message center. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move MessageCenterButtonBar into cc file to hide implementation. Created 7 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 | Annotate | Revision Log
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/message_bubble_base.h" 5 #include "ui/message_center/views/message_bubble_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "ui/message_center/message_center_style.h" 8 #include "ui/message_center/message_center_style.h"
9 #include "ui/message_center/message_center_util.h" 9 #include "ui/message_center/message_center_util.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 weak_ptr_factory_.GetWeakPtr()), 49 weak_ptr_factory_.GetWeakPtr()),
50 base::TimeDelta::FromMilliseconds(kUpdateDelayMs)); 50 base::TimeDelta::FromMilliseconds(kUpdateDelayMs));
51 } 51 }
52 52
53 bool MessageBubbleBase::IsVisible() const { 53 bool MessageBubbleBase::IsVisible() const {
54 return bubble_view() && bubble_view()->GetWidget()->IsVisible(); 54 return bubble_view() && bubble_view()->GetWidget()->IsVisible();
55 } 55 }
56 56
57 void MessageBubbleBase::SetMaxHeight(int height) { 57 void MessageBubbleBase::SetMaxHeight(int height) {
58 // Maximum height makes sense only for the new design. 58 // Maximum height makes sense only for the new design.
59 if (!message_center::IsRichNotificationEnabled())
60 return;
61
62 if (height == 0) 59 if (height == 0)
63 height = kMessageBubbleBaseDefaultMaxHeight; 60 height = kMessageBubbleBaseDefaultMaxHeight;
64 if (height == max_height_) 61 if (height == max_height_)
65 return; 62 return;
66 63
67 max_height_ = height; 64 max_height_ = height;
68 if (bubble_view_) 65 if (bubble_view_)
69 bubble_view_->SetMaxHeight(max_height_); 66 bubble_view_->SetMaxHeight(max_height_);
70 } 67 }
71 68
72 views::TrayBubbleView::InitParams MessageBubbleBase::GetDefaultInitParams( 69 views::TrayBubbleView::InitParams MessageBubbleBase::GetDefaultInitParams(
73 views::TrayBubbleView::AnchorAlignment anchor_alignment) { 70 views::TrayBubbleView::AnchorAlignment anchor_alignment) {
74 views::TrayBubbleView::InitParams init_params( 71 views::TrayBubbleView::InitParams init_params(
75 views::TrayBubbleView::ANCHOR_TYPE_TRAY, 72 views::TrayBubbleView::ANCHOR_TYPE_TRAY,
76 anchor_alignment, 73 anchor_alignment,
77 kNotificationWidth, 74 kNotificationWidth,
78 kNotificationWidth); 75 kNotificationWidth);
79 init_params.arrow_color = kBackgroundDarkColor; 76 init_params.arrow_color = kBackgroundDarkColor;
80 return init_params; 77 return init_params;
81 } 78 }
82 79
83 } // namespace message_center 80 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/message_center_tray_unittest.cc ('k') | ui/message_center/views/message_center_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698