| 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/message_loop.h" | 9 #include "base/message_loop.h" |
| 9 #include "base/task.h" | 10 #include "base/task.h" |
| 10 #include "views/grid_layout.h" | 11 #include "views/grid_layout.h" |
| 11 #include "views/controls/label.h" | 12 #include "views/controls/label.h" |
| 12 #include "views/controls/text_field.h" | 13 #include "views/controls/text_field.h" |
| 13 #include "views/standard_layout.h" | 14 #include "views/standard_layout.h" |
| 14 #include "views/window/dialog_delegate.h" | 15 #include "views/window/dialog_delegate.h" |
| 15 #include "views/window/window.h" | 16 #include "views/window/window.h" |
| 16 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
| 17 | 18 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 // ContentView, as the name implies, is the content view for the InputWindow. | 56 // ContentView, as the name implies, is the content view for the InputWindow. |
| 56 // It registers accelerators that accept/cancel the input. | 57 // It registers accelerators that accept/cancel the input. |
| 57 class ContentView : public views::View, | 58 class ContentView : public views::View, |
| 58 public views::DialogDelegate, | 59 public views::DialogDelegate, |
| 59 public views::TextField::Controller { | 60 public views::TextField::Controller { |
| 60 public: | 61 public: |
| 61 explicit ContentView(WinInputWindowDialog* delegate) | 62 explicit ContentView(WinInputWindowDialog* delegate) |
| 62 : delegate_(delegate), | 63 : delegate_(delegate), |
| 63 focus_grabber_factory_(this) { | 64 ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)) { |
| 64 DCHECK(delegate_); | 65 DCHECK(delegate_); |
| 65 } | 66 } |
| 66 | 67 |
| 67 // views::DialogDelegate overrides: | 68 // views::DialogDelegate overrides: |
| 68 virtual bool IsDialogButtonEnabled( | 69 virtual bool IsDialogButtonEnabled( |
| 69 MessageBoxFlags::DialogButton button) const; | 70 MessageBoxFlags::DialogButton button) const; |
| 70 virtual bool Accept(); | 71 virtual bool Accept(); |
| 71 virtual bool Cancel(); | 72 virtual bool Cancel(); |
| 72 virtual void DeleteDelegate(); | 73 virtual void DeleteDelegate(); |
| 73 virtual std::wstring GetWindowTitle() const; | 74 virtual std::wstring GetWindowTitle() const; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 const std::wstring& window_title, | 226 const std::wstring& window_title, |
| 226 const std::wstring& label, | 227 const std::wstring& label, |
| 227 const std::wstring& contents, | 228 const std::wstring& contents, |
| 228 Delegate* delegate) { | 229 Delegate* delegate) { |
| 229 return new WinInputWindowDialog(parent, | 230 return new WinInputWindowDialog(parent, |
| 230 window_title, | 231 window_title, |
| 231 label, | 232 label, |
| 232 contents, | 233 contents, |
| 233 delegate); | 234 delegate); |
| 234 } | 235 } |
| OLD | NEW |