| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 views::kPanelVertMargin, views::kPanelHorizMargin, | 66 views::kPanelVertMargin, views::kPanelHorizMargin, |
| 67 views::kPanelVertMargin, views::kPanelHorizMargin)); | 67 views::kPanelVertMargin, views::kPanelHorizMargin)); |
| 68 } | 68 } |
| 69 AddChildView(content); | 69 AddChildView(content); |
| 70 SetLayoutManager(new views::FillLayout()); | 70 SetLayoutManager(new views::FillLayout()); |
| 71 | 71 |
| 72 views::DialogDelegate::CreateDialogWidget( | 72 views::DialogDelegate::CreateDialogWidget( |
| 73 this, ash::Shell::GetPrimaryRootWindow(), NULL)->Show(); | 73 this, ash::Shell::GetPrimaryRootWindow(), NULL)->Show(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void IdleActionWarningDialogView::Close() { | 76 void IdleActionWarningDialogView::CloseDialog() { |
| 77 closing_ = true; | 77 closing_ = true; |
| 78 GetDialogClientView()->CancelWindow(); | 78 GetDialogClientView()->CancelWindow(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 ui::ModalType IdleActionWarningDialogView::GetModalType() const { | 81 ui::ModalType IdleActionWarningDialogView::GetModalType() const { |
| 82 return ui::MODAL_TYPE_SYSTEM; | 82 return ui::MODAL_TYPE_SYSTEM; |
| 83 } | 83 } |
| 84 | 84 |
| 85 string16 IdleActionWarningDialogView::GetWindowTitle() const { | 85 string16 IdleActionWarningDialogView::GetWindowTitle() const { |
| 86 return l10n_util::GetStringUTF16(IDS_IDLE_WARNING_TITLE); | 86 return l10n_util::GetStringUTF16(IDS_IDLE_WARNING_TITLE); |
| 87 } | 87 } |
| 88 | 88 |
| 89 int IdleActionWarningDialogView::GetDialogButtons() const { | 89 int IdleActionWarningDialogView::GetDialogButtons() const { |
| 90 return ui::DIALOG_BUTTON_NONE; | 90 return ui::DIALOG_BUTTON_NONE; |
| 91 } | 91 } |
| 92 | 92 |
| 93 bool IdleActionWarningDialogView::Cancel() { | 93 bool IdleActionWarningDialogView::Cancel() { |
| 94 return closing_; | 94 return closing_; |
| 95 } | 95 } |
| 96 | 96 |
| 97 IdleActionWarningDialogView::~IdleActionWarningDialogView() { | 97 IdleActionWarningDialogView::~IdleActionWarningDialogView() { |
| 98 } | 98 } |
| 99 | 99 |
| 100 } // namespace chromeos | 100 } // namespace chromeos |
| OLD | NEW |