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

Side by Side Diff: ash/common/system/date/date_default_view.cc

Issue 2480813003: Reduce views::Border creation verbosity by promoting factory functions (Closed)
Patch Set: fix bad merge Created 4 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/common/system/date/date_default_view.h" 5 #include "ash/common/system/date/date_default_view.h"
6 6
7 #include "ash/common/metrics/user_metrics_action.h" 7 #include "ash/common/metrics/user_metrics_action.h"
8 #include "ash/common/session/session_state_delegate.h" 8 #include "ash/common/session/session_state_delegate.h"
9 #include "ash/common/system/date/date_view.h" 9 #include "ash/common/system/date/date_view.h"
10 #include "ash/common/system/tray/special_popup_row.h" 10 #include "ash/common/system/tray/special_popup_row.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 DateDefaultView::DateDefaultView(SystemTrayItem* owner, LoginStatus login) 43 DateDefaultView::DateDefaultView(SystemTrayItem* owner, LoginStatus login)
44 : help_button_(nullptr), 44 : help_button_(nullptr),
45 shutdown_button_(nullptr), 45 shutdown_button_(nullptr),
46 lock_button_(nullptr), 46 lock_button_(nullptr),
47 date_view_(nullptr), 47 date_view_(nullptr),
48 weak_factory_(this) { 48 weak_factory_(this) {
49 SetLayoutManager(new views::FillLayout); 49 SetLayoutManager(new views::FillLayout);
50 50
51 date_view_ = new tray::DateView(owner); 51 date_view_ = new tray::DateView(owner);
52 date_view_->SetBorder(views::Border::CreateEmptyBorder( 52 date_view_->SetBorder(views::CreateEmptyBorder(
53 kPaddingVertical, ash::kTrayPopupPaddingHorizontal, 0, 0)); 53 kPaddingVertical, ash::kTrayPopupPaddingHorizontal, 0, 0));
54 SpecialPopupRow* view = new SpecialPopupRow(); 54 SpecialPopupRow* view = new SpecialPopupRow();
55 view->SetContent(date_view_); 55 view->SetContent(date_view_);
56 AddChildView(view); 56 AddChildView(view);
57 57
58 WmShell* shell = WmShell::Get(); 58 WmShell* shell = WmShell::Get();
59 const bool adding_user = 59 const bool adding_user =
60 shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); 60 shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen();
61 61
62 if (login == LoginStatus::LOCKED || login == LoginStatus::NOT_LOGGED_IN || 62 if (login == LoginStatus::LOCKED || login == LoginStatus::NOT_LOGGED_IN ||
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 void DateDefaultView::OnShutdownPolicyChanged(bool reboot_on_shutdown) { 158 void DateDefaultView::OnShutdownPolicyChanged(bool reboot_on_shutdown) {
159 if (!shutdown_button_) 159 if (!shutdown_button_)
160 return; 160 return;
161 161
162 shutdown_button_->SetTooltipText(l10n_util::GetStringUTF16( 162 shutdown_button_->SetTooltipText(l10n_util::GetStringUTF16(
163 reboot_on_shutdown ? IDS_ASH_STATUS_TRAY_REBOOT 163 reboot_on_shutdown ? IDS_ASH_STATUS_TRAY_REBOOT
164 : IDS_ASH_STATUS_TRAY_SHUTDOWN)); 164 : IDS_ASH_STATUS_TRAY_SHUTDOWN));
165 } 165 }
166 166
167 } // namespace ash 167 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc ('k') | ash/common/system/date/date_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698