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

Side by Side Diff: ash/system/chromeos/label_tray_view.cc

Issue 145033006: views: Make View::set_border() take a scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 6 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
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 "ash/system/chromeos/label_tray_view.h" 5 #include "ash/system/chromeos/label_tray_view.h"
6 6
7 #include "ash/system/tray/hover_highlight_view.h" 7 #include "ash/system/tray/hover_highlight_view.h"
8 #include "ash/system/tray/tray_constants.h" 8 #include "ash/system/tray/tray_constants.h"
9 #include "ash/system/tray/view_click_listener.h" 9 #include "ash/system/tray/view_click_listener.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 } 42 }
43 43
44 views::View* LabelTrayView::CreateChildView( 44 views::View* LabelTrayView::CreateChildView(
45 const base::string16& message) const { 45 const base::string16& message) const {
46 HoverHighlightView* child = new HoverHighlightView(click_listener_); 46 HoverHighlightView* child = new HoverHighlightView(click_listener_);
47 if (icon_resource_id_) { 47 if (icon_resource_id_) {
48 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 48 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
49 const gfx::ImageSkia* icon = rb.GetImageSkiaNamed(icon_resource_id_); 49 const gfx::ImageSkia* icon = rb.GetImageSkiaNamed(icon_resource_id_);
50 child->AddIconAndLabel(*icon, message, gfx::Font::NORMAL); 50 child->AddIconAndLabel(*icon, message, gfx::Font::NORMAL);
51 child->set_border( 51 child->SetBorder(views::Border::CreateEmptyBorder(
52 views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, 52 0, kTrayPopupPaddingHorizontal, 0, kTrayPopupPaddingHorizontal));
53 0, kTrayPopupPaddingHorizontal));
54 child->text_label()->SetMultiLine(true); 53 child->text_label()->SetMultiLine(true);
55 child->text_label()->SizeToFit(kTrayNotificationContentsWidth); 54 child->text_label()->SizeToFit(kTrayNotificationContentsWidth);
56 } else { 55 } else {
57 child->AddLabel(message, gfx::Font::NORMAL); 56 child->AddLabel(message, gfx::Font::NORMAL);
58 child->text_label()->SetMultiLine(true); 57 child->text_label()->SetMultiLine(true);
59 child->text_label()->SizeToFit(kTrayNotificationContentsWidth + 58 child->text_label()->SizeToFit(kTrayNotificationContentsWidth +
60 kNotificationIconWidth); 59 kNotificationIconWidth);
61 } 60 }
62 child->text_label()->SetAllowCharacterBreak(true); 61 child->text_label()->SetAllowCharacterBreak(true);
63 child->SetExpandable(true); 62 child->SetExpandable(true);
64 child->SetVisible(true); 63 child->SetVisible(true);
65 return child; 64 return child;
66 } 65 }
67 66
68 } // namespace internal 67 } // namespace internal
69 } // namespace ash 68 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/audio/tray_audio.cc ('k') | ash/system/chromeos/network/network_state_list_detailed_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698