| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/input_window_dialog.h" | 5 #include "chrome/browser/input_window_dialog.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/task.h" | 10 #include "base/task.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 DISALLOW_COPY_AND_ASSIGN(ContentView); | 108 DISALLOW_COPY_AND_ASSIGN(ContentView); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 /////////////////////////////////////////////////////////////////////////////// | 111 /////////////////////////////////////////////////////////////////////////////// |
| 112 // ContentView, views::DialogDelegate implementation: | 112 // ContentView, views::DialogDelegate implementation: |
| 113 | 113 |
| 114 bool ContentView::IsDialogButtonEnabled( | 114 bool ContentView::IsDialogButtonEnabled( |
| 115 MessageBoxFlags::DialogButton button) const { | 115 MessageBoxFlags::DialogButton button) const { |
| 116 if (button == MessageBoxFlags::DIALOGBUTTON_OK && | 116 if (button == MessageBoxFlags::DIALOGBUTTON_OK && |
| 117 !delegate_->delegate()->IsValid(text_field_->GetText())) { | 117 !delegate_->delegate()->IsValid(text_field_->text())) { |
| 118 return false; | 118 return false; |
| 119 } | 119 } |
| 120 return true; | 120 return true; |
| 121 } | 121 } |
| 122 | 122 |
| 123 bool ContentView::Accept() { | 123 bool ContentView::Accept() { |
| 124 delegate_->delegate()->InputAccepted(text_field_->GetText()); | 124 delegate_->delegate()->InputAccepted(text_field_->text()); |
| 125 return true; | 125 return true; |
| 126 } | 126 } |
| 127 | 127 |
| 128 bool ContentView::Cancel() { | 128 bool ContentView::Cancel() { |
| 129 delegate_->delegate()->InputCanceled(); | 129 delegate_->delegate()->InputCanceled(); |
| 130 return true; | 130 return true; |
| 131 } | 131 } |
| 132 | 132 |
| 133 void ContentView::DeleteDelegate() { | 133 void ContentView::DeleteDelegate() { |
| 134 delete delegate_; | 134 delete delegate_; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 const std::wstring& window_title, | 227 const std::wstring& window_title, |
| 228 const std::wstring& label, | 228 const std::wstring& label, |
| 229 const std::wstring& contents, | 229 const std::wstring& contents, |
| 230 Delegate* delegate) { | 230 Delegate* delegate) { |
| 231 return new WinInputWindowDialog(parent, | 231 return new WinInputWindowDialog(parent, |
| 232 window_title, | 232 window_title, |
| 233 label, | 233 label, |
| 234 contents, | 234 contents, |
| 235 delegate); | 235 delegate); |
| 236 } | 236 } |
| OLD | NEW |