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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // ItemView //////////////////////////////////////////////////////////////////// | 108 // ItemView //////////////////////////////////////////////////////////////////// |
109 | 109 |
110 // ItemViews are responsible for drawing each list notification item's title and | 110 // ItemViews are responsible for drawing each list notification item's title and |
111 // message next to each other within a single column. | 111 // message next to each other within a single column. |
112 class ItemView : public views::View { | 112 class ItemView : public views::View { |
113 public: | 113 public: |
114 ItemView(const message_center::NotificationItem& item); | 114 ItemView(const message_center::NotificationItem& item); |
115 virtual ~ItemView(); | 115 virtual ~ItemView(); |
116 | 116 |
117 // Overridden from views::View: | 117 // Overridden from views::View: |
118 virtual void SetVisible(bool visible) OVERRIDE; | 118 virtual void SetVisible(bool visible) override; |
119 | 119 |
120 private: | 120 private: |
121 DISALLOW_COPY_AND_ASSIGN(ItemView); | 121 DISALLOW_COPY_AND_ASSIGN(ItemView); |
122 }; | 122 }; |
123 | 123 |
124 ItemView::ItemView(const message_center::NotificationItem& item) { | 124 ItemView::ItemView(const message_center::NotificationItem& item) { |
125 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, | 125 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, |
126 0, 0, message_center::kItemTitleToMessagePadding)); | 126 0, 0, message_center::kItemTitleToMessagePadding)); |
127 | 127 |
128 views::Label* title = new views::Label(item.title); | 128 views::Label* title = new views::Label(item.title); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 // NotificationProgressBar ///////////////////////////////////////////////////// | 188 // NotificationProgressBar ///////////////////////////////////////////////////// |
189 | 189 |
190 class NotificationProgressBar : public views::ProgressBar { | 190 class NotificationProgressBar : public views::ProgressBar { |
191 public: | 191 public: |
192 NotificationProgressBar(); | 192 NotificationProgressBar(); |
193 virtual ~NotificationProgressBar(); | 193 virtual ~NotificationProgressBar(); |
194 | 194 |
195 private: | 195 private: |
196 // Overriden from View | 196 // Overriden from View |
197 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 197 virtual gfx::Size GetPreferredSize() const override; |
198 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 198 virtual void OnPaint(gfx::Canvas* canvas) override; |
199 | 199 |
200 DISALLOW_COPY_AND_ASSIGN(NotificationProgressBar); | 200 DISALLOW_COPY_AND_ASSIGN(NotificationProgressBar); |
201 }; | 201 }; |
202 | 202 |
203 NotificationProgressBar::NotificationProgressBar() { | 203 NotificationProgressBar::NotificationProgressBar() { |
204 } | 204 } |
205 | 205 |
206 NotificationProgressBar::~NotificationProgressBar() { | 206 NotificationProgressBar::~NotificationProgressBar() { |
207 } | 207 } |
208 | 208 |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 | 785 |
786 return message_line_limit; | 786 return message_line_limit; |
787 } | 787 } |
788 | 788 |
789 int NotificationView::GetMessageHeight(int width, int limit) const { | 789 int NotificationView::GetMessageHeight(int width, int limit) const { |
790 return message_view_ ? | 790 return message_view_ ? |
791 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; | 791 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; |
792 } | 792 } |
793 | 793 |
794 } // namespace message_center | 794 } // namespace message_center |
OLD | NEW |