| 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 "ui/base/l10n/l10n_util.h" | 8 #include "ui/base/l10n/l10n_util.h" |
| 9 #include "ui/strings/grit/ui_strings.h" | 9 #include "ui/strings/grit/ui_strings.h" |
| 10 #include "ui/views/bubble/bubble_border.h" | 10 #include "ui/views/bubble/bubble_border.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 bool DialogDelegate::Close() { | 99 bool DialogDelegate::Close() { |
| 100 int buttons = GetDialogButtons(); | 100 int buttons = GetDialogButtons(); |
| 101 if ((buttons & ui::DIALOG_BUTTON_CANCEL) || | 101 if ((buttons & ui::DIALOG_BUTTON_CANCEL) || |
| 102 (buttons == ui::DIALOG_BUTTON_NONE)) { | 102 (buttons == ui::DIALOG_BUTTON_NONE)) { |
| 103 return Cancel(); | 103 return Cancel(); |
| 104 } | 104 } |
| 105 return Accept(true); | 105 return Accept(true); |
| 106 } | 106 } |
| 107 | 107 |
| 108 base::string16 DialogDelegate::GetDialogLabel() const { | |
| 109 return base::string16(); | |
| 110 } | |
| 111 | |
| 112 base::string16 DialogDelegate::GetDialogTitle() const { | 108 base::string16 DialogDelegate::GetDialogTitle() const { |
| 113 return GetWindowTitle(); | 109 return GetWindowTitle(); |
| 114 } | 110 } |
| 115 | 111 |
| 116 int DialogDelegate::GetDialogButtons() const { | 112 int DialogDelegate::GetDialogButtons() const { |
| 117 return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL; | 113 return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL; |
| 118 } | 114 } |
| 119 | 115 |
| 120 int DialogDelegate::GetDefaultDialogButton() const { | 116 int DialogDelegate::GetDefaultDialogButton() const { |
| 121 if (GetDialogButtons() & ui::DIALOG_BUTTON_OK) | 117 if (GetDialogButtons() & ui::DIALOG_BUTTON_OK) |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 228 |
| 233 const Widget* DialogDelegateView::GetWidget() const { | 229 const Widget* DialogDelegateView::GetWidget() const { |
| 234 return View::GetWidget(); | 230 return View::GetWidget(); |
| 235 } | 231 } |
| 236 | 232 |
| 237 View* DialogDelegateView::GetContentsView() { | 233 View* DialogDelegateView::GetContentsView() { |
| 238 return this; | 234 return this; |
| 239 } | 235 } |
| 240 | 236 |
| 241 } // namespace views | 237 } // namespace views |
| OLD | NEW |