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

Side by Side Diff: ui/message_center/message_center_bubble.cc

Issue 11926032: Updated the look of web and basic notifications to match latest mockups. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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.gyp ('k') | ui/message_center/message_popup_bubble.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) 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/message_center_bubble.h" 5 #include "ui/message_center/message_center_bubble.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "grit/ui_strings.h" 8 #include "grit/ui_strings.h"
9 #include "third_party/skia/include/core/SkPaint.h" 9 #include "third_party/skia/include/core/SkPaint.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
11 #include "ui/base/resource/resource_bundle.h" 11 #include "ui/base/resource/resource_bundle.h"
12 #include "ui/gfx/canvas.h" 12 #include "ui/gfx/canvas.h"
13 #include "ui/gfx/insets.h" 13 #include "ui/gfx/insets.h"
14 #include "ui/gfx/point.h" 14 #include "ui/gfx/point.h"
15 #include "ui/gfx/rect.h" 15 #include "ui/gfx/rect.h"
16 #include "ui/gfx/shadow_value.h" 16 #include "ui/gfx/shadow_value.h"
17 #include "ui/gfx/size.h" 17 #include "ui/gfx/size.h"
18 #include "ui/gfx/skia_util.h" 18 #include "ui/gfx/skia_util.h"
19 #include "ui/gfx/text_constants.h" 19 #include "ui/gfx/text_constants.h"
20 #include "ui/message_center/message_center_switches.h" 20 #include "ui/message_center/message_center_switches.h"
21 #include "ui/message_center/message_view.h" 21 #include "ui/message_center/message_view.h"
22 #include "ui/message_center/message_view_factory.h" 22 #include "ui/message_center/notification_view.h"
23 #include "ui/views/background.h" 23 #include "ui/views/background.h"
24 #include "ui/views/border.h" 24 #include "ui/views/border.h"
25 #include "ui/views/controls/button/text_button.h" 25 #include "ui/views/controls/button/text_button.h"
26 #include "ui/views/controls/label.h" 26 #include "ui/views/controls/label.h"
27 #include "ui/views/controls/scroll_view.h" 27 #include "ui/views/controls/scroll_view.h"
28 #include "ui/views/layout/box_layout.h" 28 #include "ui/views/layout/box_layout.h"
29 #include "ui/views/layout/grid_layout.h" 29 #include "ui/views/layout/grid_layout.h"
30 #include "ui/views/painter.h" 30 #include "ui/views/painter.h"
31 #include "ui/views/view.h" 31 #include "ui/views/view.h"
32 #include "ui/views/widget/widget.h" 32 #include "ui/views/widget/widget.h"
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 scroller_->RequestFocus(); 428 scroller_->RequestFocus();
429 } 429 }
430 430
431 void Update(const NotificationList::Notifications& notifications) { 431 void Update(const NotificationList::Notifications& notifications) {
432 scroll_content_->RemoveAllChildViews(true); 432 scroll_content_->RemoveAllChildViews(true);
433 scroll_content_->set_preferred_size(gfx::Size()); 433 scroll_content_->set_preferred_size(gfx::Size());
434 size_t num_children = 0; 434 size_t num_children = 0;
435 for (NotificationList::Notifications::const_iterator iter = 435 for (NotificationList::Notifications::const_iterator iter =
436 notifications.begin(); iter != notifications.end(); ++iter) { 436 notifications.begin(); iter != notifications.end(); ++iter) {
437 MessageView* view = 437 MessageView* view =
438 MessageViewFactory::ViewForNotification(*iter, list_delegate_); 438 NotificationView::ViewForNotification(*iter, list_delegate_);
439 view->set_scroller(scroller_); 439 view->set_scroller(scroller_);
440 view->SetUpView(); 440 view->SetUpView();
441 if (UseNewDesign()) { 441 if (UseNewDesign()) {
442 views::View* container = new views::View(); 442 views::View* container = new views::View();
443 container->SetLayoutManager(new FillWithBorderLayout()); 443 container->SetLayoutManager(new FillWithBorderLayout());
444 container->set_border(new MessageViewShadowBorder()); 444 container->set_border(new MessageViewShadowBorder());
445 container->AddChildView(view); 445 container->AddChildView(view);
446 scroll_content_->AddChildView(container); 446 scroll_content_->AddChildView(container);
447 } else { 447 } else {
448 scroll_content_->AddChildView(view); 448 scroll_content_->AddChildView(view);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 } 552 }
553 553
554 void MessageCenterBubble::OnMouseExitedView() { 554 void MessageCenterBubble::OnMouseExitedView() {
555 } 555 }
556 556
557 size_t MessageCenterBubble::NumMessageViewsForTest() const { 557 size_t MessageCenterBubble::NumMessageViewsForTest() const {
558 return contents_view_->NumMessageViews(); 558 return contents_view_->NumMessageViews();
559 } 559 }
560 560
561 } // namespace message_center 561 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/message_center.gyp ('k') | ui/message_center/message_popup_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698