Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 if (DialogDelegate::UseNewStyle()) { |
|
msw
2013/04/16 01:58:24
nit: I prefer the pattern of setting a local first
Evan Stade
2013/04/16 19:58:25
Normally I do as well, except that this should cha
| |
| 61 views::kPanelVertMargin, views::kPanelHorizMargin, | 61 content->set_border(views::Border::CreateEmptyBorder( |
| 62 views::kPanelVertMargin, views::kPanelHorizMargin)); | 62 views::kPanelVertMargin, views::kButtonHEdgeMarginNew, |
| 63 views::kPanelVertMargin, views::kButtonHEdgeMarginNew)); | |
| 64 } else { | |
| 65 content->set_border(views::Border::CreateEmptyBorder( | |
| 66 views::kPanelVertMargin, views::kPanelHorizMargin, | |
| 67 views::kPanelVertMargin, views::kPanelHorizMargin)); | |
| 68 } | |
| 63 AddChildView(content); | 69 AddChildView(content); |
| 64 SetLayoutManager(new views::FillLayout()); | 70 SetLayoutManager(new views::FillLayout()); |
| 65 | 71 |
| 66 views::Widget::CreateWindowWithContext(this, | 72 views::Widget::CreateWindowWithContext(this, |
| 67 ash::Shell::GetPrimaryRootWindow()); | 73 ash::Shell::GetPrimaryRootWindow()); |
| 68 GetWidget()->Show(); | 74 GetWidget()->Show(); |
| 69 } | 75 } |
| 70 | 76 |
| 71 void IdleActionWarningDialogView::Close() { | 77 void IdleActionWarningDialogView::Close() { |
| 72 closing_ = true; | 78 closing_ = true; |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 86 } | 92 } |
| 87 | 93 |
| 88 bool IdleActionWarningDialogView::Cancel() { | 94 bool IdleActionWarningDialogView::Cancel() { |
| 89 return closing_; | 95 return closing_; |
| 90 } | 96 } |
| 91 | 97 |
| 92 IdleActionWarningDialogView::~IdleActionWarningDialogView() { | 98 IdleActionWarningDialogView::~IdleActionWarningDialogView() { |
| 93 } | 99 } |
| 94 | 100 |
| 95 } // namespace chromeos | 101 } // namespace chromeos |
| OLD | NEW |