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

Side by Side Diff: chrome/browser/chromeos/power/idle_action_warning_dialog_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/chromeos/power/idle_action_warning_dialog_view.h" 5 #include "chrome/browser/chromeos/power/idle_action_warning_dialog_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return gfx::Size(width_, GetHeightForWidth(width_)); 56 return gfx::Size(width_, GetHeightForWidth(width_));
57 } 57 }
58 58
59 } // namespace 59 } // namespace
60 60
61 IdleActionWarningDialogView::IdleActionWarningDialogView( 61 IdleActionWarningDialogView::IdleActionWarningDialogView(
62 base::TimeTicks idle_action_time) 62 base::TimeTicks idle_action_time)
63 : idle_action_time_(idle_action_time), 63 : idle_action_time_(idle_action_time),
64 label_(NULL) { 64 label_(NULL) {
65 label_ = new FixedWidthLabel(kIdleActionWarningContentWidth); 65 label_ = new FixedWidthLabel(kIdleActionWarningContentWidth);
66 label_->SetBorder( 66 label_->SetBorder(views::CreateEmptyBorder(
67 views::Border::CreateEmptyBorder(views::kPanelVertMargin, 67 views::kPanelVertMargin, views::kButtonHEdgeMarginNew,
68 views::kButtonHEdgeMarginNew, 68 views::kPanelVertMargin, views::kButtonHEdgeMarginNew));
69 views::kPanelVertMargin,
70 views::kButtonHEdgeMarginNew));
71 AddChildView(label_); 69 AddChildView(label_);
72 SetLayoutManager(new views::FillLayout()); 70 SetLayoutManager(new views::FillLayout());
73 71
74 UpdateLabel(); 72 UpdateLabel();
75 73
76 views::DialogDelegate::CreateDialogWidget( 74 views::DialogDelegate::CreateDialogWidget(
77 this, ash::Shell::GetPrimaryRootWindow(), NULL)->Show(); 75 this, ash::Shell::GetPrimaryRootWindow(), NULL)->Show();
78 76
79 update_timer_.Start( 77 update_timer_.Start(
80 FROM_HERE, 78 FROM_HERE,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 base::TimeDelta()); 116 base::TimeDelta());
119 label_->SetText(l10n_util::GetStringFUTF16( 117 label_->SetText(l10n_util::GetStringFUTF16(
120 IDS_IDLE_WARNING_LOGOUT_WARNING, 118 IDS_IDLE_WARNING_LOGOUT_WARNING,
121 ui::TimeFormat::Detailed(ui::TimeFormat::FORMAT_DURATION, 119 ui::TimeFormat::Detailed(ui::TimeFormat::FORMAT_DURATION,
122 ui::TimeFormat::LENGTH_LONG, 120 ui::TimeFormat::LENGTH_LONG,
123 10, 121 10,
124 time_until_idle_action))); 122 time_until_idle_action)));
125 } 123 }
126 124
127 } // namespace chromeos 125 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698