| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/window/dialog_delegate.h" | 5 #include "ui/views/window/dialog_delegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "grit/ui_strings.h" | 8 #include "grit/ui_strings.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 #include "ui/base/ui_base_switches_util.h" | 10 #include "ui/base/ui_base_switches_util.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool DialogDelegate::Accept(bool window_closing) { | 80 bool DialogDelegate::Accept(bool window_closing) { |
| 81 return Accept(); | 81 return Accept(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 bool DialogDelegate::Accept() { | 84 bool DialogDelegate::Accept() { |
| 85 return true; | 85 return true; |
| 86 } | 86 } |
| 87 | 87 |
| 88 bool DialogDelegate::Close() { |
| 89 int buttons = GetDialogButtons(); |
| 90 if ((buttons & ui::DIALOG_BUTTON_CANCEL) || |
| 91 (buttons == ui::DIALOG_BUTTON_NONE)) { |
| 92 return Cancel(); |
| 93 } |
| 94 return Accept(true); |
| 95 } |
| 96 |
| 88 base::string16 DialogDelegate::GetDialogLabel() const { | 97 base::string16 DialogDelegate::GetDialogLabel() const { |
| 89 return base::string16(); | 98 return base::string16(); |
| 90 } | 99 } |
| 91 | 100 |
| 92 base::string16 DialogDelegate::GetDialogTitle() const { | 101 base::string16 DialogDelegate::GetDialogTitle() const { |
| 93 return base::string16(); | 102 return base::string16(); |
| 94 } | 103 } |
| 95 | 104 |
| 96 int DialogDelegate::GetDialogButtons() const { | 105 int DialogDelegate::GetDialogButtons() const { |
| 97 return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL; | 106 return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 | 239 |
| 231 const Widget* DialogDelegateView::GetWidget() const { | 240 const Widget* DialogDelegateView::GetWidget() const { |
| 232 return View::GetWidget(); | 241 return View::GetWidget(); |
| 233 } | 242 } |
| 234 | 243 |
| 235 View* DialogDelegateView::GetContentsView() { | 244 View* DialogDelegateView::GetContentsView() { |
| 236 return this; | 245 return this; |
| 237 } | 246 } |
| 238 | 247 |
| 239 } // namespace views | 248 } // namespace views |
| OLD | NEW |