| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/input_window.h" | 5 #include "chrome/browser/views/input_window.h" |
| 6 | 6 |
| 7 #include "chrome/browser/views/standard_layout.h" | 7 #include "chrome/browser/views/standard_layout.h" |
| 8 #include "chrome/common/l10n_util.h" | 8 #include "chrome/common/l10n_util.h" |
| 9 #include "chrome/views/grid_layout.h" | 9 #include "chrome/views/grid_layout.h" |
| 10 #include "chrome/views/label.h" | 10 #include "chrome/views/label.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 : delegate_(delegate), | 28 : delegate_(delegate), |
| 29 focus_grabber_factory_(this) { | 29 focus_grabber_factory_(this) { |
| 30 DCHECK(delegate_); | 30 DCHECK(delegate_); |
| 31 } | 31 } |
| 32 | 32 |
| 33 // views::DialogDelegate overrides: | 33 // views::DialogDelegate overrides: |
| 34 virtual bool IsDialogButtonEnabled(DialogButton button) const; | 34 virtual bool IsDialogButtonEnabled(DialogButton button) const; |
| 35 virtual bool Accept(); | 35 virtual bool Accept(); |
| 36 virtual bool Cancel(); | 36 virtual bool Cancel(); |
| 37 virtual void WindowClosing(); | 37 virtual void WindowClosing(); |
| 38 virtual void DeleteDelegate(); |
| 38 virtual std::wstring GetWindowTitle() const; | 39 virtual std::wstring GetWindowTitle() const; |
| 39 virtual bool IsModal() const { return true; } | 40 virtual bool IsModal() const { return true; } |
| 40 virtual views::View* GetContentsView(); | 41 virtual views::View* GetContentsView(); |
| 41 | 42 |
| 42 // views::TextField::Controller overrides: | 43 // views::TextField::Controller overrides: |
| 43 virtual void ContentsChanged(views::TextField* sender, | 44 virtual void ContentsChanged(views::TextField* sender, |
| 44 const std::wstring& new_contents); | 45 const std::wstring& new_contents); |
| 45 virtual void HandleKeystroke(views::TextField*, UINT, TCHAR, UINT, UINT) {} | 46 virtual void HandleKeystroke(views::TextField*, UINT, TCHAR, UINT, UINT) {} |
| 46 | 47 |
| 47 protected: | 48 protected: |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 86 |
| 86 bool ContentView::Cancel() { | 87 bool ContentView::Cancel() { |
| 87 delegate_->InputCanceled(); | 88 delegate_->InputCanceled(); |
| 88 return true; | 89 return true; |
| 89 } | 90 } |
| 90 | 91 |
| 91 void ContentView::WindowClosing() { | 92 void ContentView::WindowClosing() { |
| 92 delegate_->WindowClosing(); | 93 delegate_->WindowClosing(); |
| 93 } | 94 } |
| 94 | 95 |
| 96 void ContentView::DeleteDelegate() { |
| 97 delegate_->DeleteDelegate(); |
| 98 } |
| 99 |
| 95 std::wstring ContentView::GetWindowTitle() const { | 100 std::wstring ContentView::GetWindowTitle() const { |
| 96 return delegate_->GetWindowTitle(); | 101 return delegate_->GetWindowTitle(); |
| 97 } | 102 } |
| 98 | 103 |
| 99 views::View* ContentView::GetContentsView() { | 104 views::View* ContentView::GetContentsView() { |
| 100 return this; | 105 return this; |
| 101 } | 106 } |
| 102 | 107 |
| 103 /////////////////////////////////////////////////////////////////////////////// | 108 /////////////////////////////////////////////////////////////////////////////// |
| 104 // ContentView, views::TextField::Controller implementation: | 109 // ContentView, views::TextField::Controller implementation: |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 162 |
| 158 views::Window* CreateInputWindow(HWND parent_hwnd, | 163 views::Window* CreateInputWindow(HWND parent_hwnd, |
| 159 InputWindowDelegate* delegate) { | 164 InputWindowDelegate* delegate) { |
| 160 views::Window* window = | 165 views::Window* window = |
| 161 views::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), | 166 views::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), |
| 162 new ContentView(delegate)); | 167 new ContentView(delegate)); |
| 163 window->client_view()->AsDialogClientView()->UpdateDialogButtons(); | 168 window->client_view()->AsDialogClientView()->UpdateDialogButtons(); |
| 164 return window; | 169 return window; |
| 165 } | 170 } |
| 166 | 171 |
| OLD | NEW |