| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/input_window_dialog.h" | 5 #include "chrome/browser/ui/input_window_dialog.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/task.h" | 9 #include "base/task.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 SetLayoutManager(layout); | 190 SetLayoutManager(layout); |
| 191 | 191 |
| 192 views::ColumnSet* c1 = layout->AddColumnSet(0); | 192 views::ColumnSet* c1 = layout->AddColumnSet(0); |
| 193 c1->AddColumn(GridLayout::CENTER, GridLayout::CENTER, 0, | 193 c1->AddColumn(GridLayout::CENTER, GridLayout::CENTER, 0, |
| 194 GridLayout::USE_PREF, 0, 0); | 194 GridLayout::USE_PREF, 0, 0); |
| 195 c1->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); | 195 c1->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); |
| 196 c1->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, | 196 c1->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, |
| 197 GridLayout::USE_PREF, kTextfieldWidth, kTextfieldWidth); | 197 GridLayout::USE_PREF, kTextfieldWidth, kTextfieldWidth); |
| 198 | 198 |
| 199 layout->StartRow(0, 0); | 199 layout->StartRow(0, 0); |
| 200 views::Label* label = new views::Label(UTF16ToWideHack(delegate_->label())); | 200 views::Label* label = new views::Label(delegate_->label()); |
| 201 layout->AddView(label); | 201 layout->AddView(label); |
| 202 layout->AddView(text_field_); | 202 layout->AddView(text_field_); |
| 203 | 203 |
| 204 MessageLoop::current()->PostTask(FROM_HERE, | 204 MessageLoop::current()->PostTask(FROM_HERE, |
| 205 focus_grabber_factory_.NewRunnableMethod( | 205 focus_grabber_factory_.NewRunnableMethod( |
| 206 &ContentView::FocusFirstFocusableControl)); | 206 &ContentView::FocusFirstFocusableControl)); |
| 207 } | 207 } |
| 208 | 208 |
| 209 void ContentView::FocusFirstFocusableControl() { | 209 void ContentView::FocusFirstFocusableControl() { |
| 210 text_field_->SelectAll(); | 210 text_field_->SelectAll(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 238 | 238 |
| 239 // static | 239 // static |
| 240 InputWindowDialog* InputWindowDialog::Create(gfx::NativeWindow parent, | 240 InputWindowDialog* InputWindowDialog::Create(gfx::NativeWindow parent, |
| 241 const string16& window_title, | 241 const string16& window_title, |
| 242 const string16& label, | 242 const string16& label, |
| 243 const string16& contents, | 243 const string16& contents, |
| 244 Delegate* delegate) { | 244 Delegate* delegate) { |
| 245 return new WinInputWindowDialog( | 245 return new WinInputWindowDialog( |
| 246 parent, window_title, label, contents, delegate); | 246 parent, window_title, label, contents, delegate); |
| 247 } | 247 } |
| OLD | NEW |