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

Side by Side Diff: chrome/browser/chromeos/power/idle_action_warning_dialog_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 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 "ash/shell.h" 7 #include "ash/shell.h"
8 #include "grit/generated_resources.h" 8 #include "grit/generated_resources.h"
9 #include "ui/aura/root_window.h" 9 #include "ui/aura/root_window.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 gfx::Size FixedWidthLabel::GetPreferredSize() { 50 gfx::Size FixedWidthLabel::GetPreferredSize() {
51 return gfx::Size(width_, GetHeightForWidth(width_)); 51 return gfx::Size(width_, GetHeightForWidth(width_));
52 } 52 }
53 53
54 } // namespace 54 } // namespace
55 55
56 IdleActionWarningDialogView::IdleActionWarningDialogView() : closing_(false) { 56 IdleActionWarningDialogView::IdleActionWarningDialogView() : closing_(false) {
57 FixedWidthLabel* content = new FixedWidthLabel( 57 FixedWidthLabel* content = new FixedWidthLabel(
58 l10n_util::GetStringUTF16(IDS_IDLE_WARNING_LOGOUT_WARNING), 58 l10n_util::GetStringUTF16(IDS_IDLE_WARNING_LOGOUT_WARNING),
59 kIdleActionWarningContentWidth); 59 kIdleActionWarningContentWidth);
60 content->set_border(views::Border::CreateEmptyBorder( 60 content->SetBorder(
61 views::kPanelVertMargin, views::kButtonHEdgeMarginNew, 61 views::Border::CreateEmptyBorder(views::kPanelVertMargin,
62 views::kPanelVertMargin, views::kButtonHEdgeMarginNew)); 62 views::kButtonHEdgeMarginNew,
63 views::kPanelVertMargin,
64 views::kButtonHEdgeMarginNew));
63 AddChildView(content); 65 AddChildView(content);
64 SetLayoutManager(new views::FillLayout()); 66 SetLayoutManager(new views::FillLayout());
65 67
66 views::DialogDelegate::CreateDialogWidget( 68 views::DialogDelegate::CreateDialogWidget(
67 this, ash::Shell::GetPrimaryRootWindow(), NULL)->Show(); 69 this, ash::Shell::GetPrimaryRootWindow(), NULL)->Show();
68 } 70 }
69 71
70 void IdleActionWarningDialogView::CloseDialog() { 72 void IdleActionWarningDialogView::CloseDialog() {
71 closing_ = true; 73 closing_ = true;
72 GetDialogClientView()->CancelWindow(); 74 GetDialogClientView()->CancelWindow();
(...skipping 12 matching lines...) Expand all
85 } 87 }
86 88
87 bool IdleActionWarningDialogView::Cancel() { 89 bool IdleActionWarningDialogView::Cancel() {
88 return closing_; 90 return closing_;
89 } 91 }
90 92
91 IdleActionWarningDialogView::~IdleActionWarningDialogView() { 93 IdleActionWarningDialogView::~IdleActionWarningDialogView() {
92 } 94 }
93 95
94 } // namespace chromeos 96 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/attestation/platform_verification_dialog.cc ('k') | chrome/browser/chromeos/ui/echo_dialog_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698