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

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

Issue 2892893002: Initial implementation of new-style notification (Closed)
Patch Set: addressed comments Created 3 years, 6 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
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_view.h" 5 #include "ui/message_center/views/message_view.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/accessibility/ax_node_data.h" 8 #include "ui/accessibility/ax_node_data.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/base/models/simple_menu_model.h" 10 #include "ui/base/models/simple_menu_model.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 SchedulePaint(); 164 SchedulePaint();
165 } 165 }
166 166
167 void MessageView::OnBlur() { 167 void MessageView::OnBlur() {
168 views::View::OnBlur(); 168 views::View::OnBlur();
169 // We paint a focus indicator. 169 // We paint a focus indicator.
170 SchedulePaint(); 170 SchedulePaint();
171 } 171 }
172 172
173 void MessageView::Layout() { 173 void MessageView::Layout() {
174 views::View::Layout();
175
174 gfx::Rect content_bounds = GetContentsBounds(); 176 gfx::Rect content_bounds = GetContentsBounds();
175 177
176 // Background. 178 // Background.
177 background_view_->SetBoundsRect(content_bounds); 179 background_view_->SetBoundsRect(content_bounds);
178 #if defined(OS_CHROMEOS) 180 #if defined(OS_CHROMEOS)
179 // ChromeOS rounds the corners of the message view. TODO(estade): should we do 181 // ChromeOS rounds the corners of the message view. TODO(estade): should we do
180 // this for all platforms? 182 // this for all platforms?
181 gfx::Path path; 183 gfx::Path path;
182 constexpr SkScalar kCornerRadius = SkIntToScalar(2); 184 constexpr SkScalar kCornerRadius = SkIntToScalar(2);
183 path.addRoundRect(gfx::RectToSkRect(background_view_->GetLocalBounds()), 185 path.addRoundRect(gfx::RectToSkRect(background_view_->GetLocalBounds()),
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } 233 }
232 234
233 void MessageView::SetDrawBackgroundAsActive(bool active) { 235 void MessageView::SetDrawBackgroundAsActive(bool active) {
234 background_view_->background()-> 236 background_view_->background()->
235 SetNativeControlColor(active ? kHoveredButtonBackgroundColor : 237 SetNativeControlColor(active ? kHoveredButtonBackgroundColor :
236 kNotificationBackgroundColor); 238 kNotificationBackgroundColor);
237 SchedulePaint(); 239 SchedulePaint();
238 } 240 }
239 241
240 } // namespace message_center 242 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/vector_icons/product.1x.icon ('k') | ui/message_center/views/message_view_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698