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

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

Issue 2095193002: clang-format all of //ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 "ash/system/chromeos/label_tray_view.h" 5 #include "ash/system/chromeos/label_tray_view.h"
6 6
7 #include "ash/common/system/tray/hover_highlight_view.h" 7 #include "ash/common/system/tray/hover_highlight_view.h"
8 #include "ash/common/system/tray/tray_constants.h" 8 #include "ash/common/system/tray/tray_constants.h"
9 #include "ash/common/system/tray/view_click_listener.h" 9 #include "ash/common/system/tray/view_click_listener.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
11 #include "ui/gfx/font.h" 11 #include "ui/gfx/font.h"
12 #include "ui/views/border.h" 12 #include "ui/views/border.h"
13 #include "ui/views/controls/label.h" 13 #include "ui/views/controls/label.h"
14 #include "ui/views/layout/fill_layout.h" 14 #include "ui/views/layout/fill_layout.h"
15 15
16 namespace ash { 16 namespace ash {
17 17
18 LabelTrayView::LabelTrayView(ViewClickListener* click_listener, 18 LabelTrayView::LabelTrayView(ViewClickListener* click_listener,
19 int icon_resource_id) 19 int icon_resource_id)
20 : click_listener_(click_listener), 20 : click_listener_(click_listener), icon_resource_id_(icon_resource_id) {
21 icon_resource_id_(icon_resource_id) {
22 SetLayoutManager(new views::FillLayout()); 21 SetLayoutManager(new views::FillLayout());
23 SetVisible(false); 22 SetVisible(false);
24 } 23 }
25 24
26 LabelTrayView::~LabelTrayView() { 25 LabelTrayView::~LabelTrayView() {}
27 }
28 26
29 void LabelTrayView::SetMessage(const base::string16& message) { 27 void LabelTrayView::SetMessage(const base::string16& message) {
30 if (message_ == message) 28 if (message_ == message)
31 return; 29 return;
32 30
33 message_ = message; 31 message_ = message;
34 RemoveAllChildViews(true); 32 RemoveAllChildViews(true);
35 if (!message_.empty()) { 33 if (!message_.empty()) {
36 AddChildView(CreateChildView(message_)); 34 AddChildView(CreateChildView(message_));
37 SetVisible(true); 35 SetVisible(true);
(...skipping 19 matching lines...) Expand all
57 child->text_label()->SizeToFit(kTrayNotificationContentsWidth + 55 child->text_label()->SizeToFit(kTrayNotificationContentsWidth +
58 kNotificationIconWidth); 56 kNotificationIconWidth);
59 } 57 }
60 child->text_label()->SetAllowCharacterBreak(true); 58 child->text_label()->SetAllowCharacterBreak(true);
61 child->SetExpandable(true); 59 child->SetExpandable(true);
62 child->SetVisible(true); 60 child->SetVisible(true);
63 return child; 61 return child;
64 } 62 }
65 63
66 } // namespace ash 64 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/label_tray_view.h ('k') | ash/system/chromeos/media_security/multi_profile_media_tray_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698