OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/chromeos/login/existing_user_view.h" | 5 #include "chrome/browser/chromeos/login/existing_user_view.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "chrome/browser/chromeos/login/helper.h" | 8 #include "chrome/browser/chromeos/login/helper.h" |
9 #include "chrome/browser/chromeos/login/user_controller.h" | 9 #include "chrome/browser/chromeos/login/user_controller.h" |
10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // Textfield with custom processing for Tab/Shift+Tab to select entries. | 38 // Textfield with custom processing for Tab/Shift+Tab to select entries. |
39 class UserEntryTextfield : public views::Textfield { | 39 class UserEntryTextfield : public views::Textfield { |
40 public: | 40 public: |
41 UserEntryTextfield(UserController* controller, | 41 UserEntryTextfield(UserController* controller, |
42 views::Textfield::StyleFlags style) | 42 views::Textfield::StyleFlags style) |
43 : Textfield(style), | 43 : Textfield(style), |
44 controller_(controller) {} | 44 controller_(controller) {} |
45 | 45 |
46 // Overridden from View: | 46 // Overridden from View: |
47 virtual bool OnKeyPressed(const views::KeyEvent& e) { | 47 virtual bool OnKeyPressed(const views::KeyEvent& e) { |
48 if (e.GetKeyCode() == app::VKEY_TAB) { | 48 if (e.GetKeyCode() == base::VKEY_TAB) { |
49 int index = controller_->user_index() + (e.IsShiftDown() ? -1 : 1); | 49 int index = controller_->user_index() + (e.IsShiftDown() ? -1 : 1); |
50 controller_->SelectUser(index); | 50 controller_->SelectUser(index); |
51 return true; | 51 return true; |
52 } else { | 52 } else { |
53 return false; | 53 return false; |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 // Overridden from views::Textfield: | 57 // Overridden from views::Textfield: |
58 virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e) { | 58 virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e) { |
59 if (e.GetKeyCode() == app::VKEY_TAB) | 59 if (e.GetKeyCode() == base::VKEY_TAB) |
60 return true; | 60 return true; |
61 else | 61 else |
62 return views::Textfield::SkipDefaultKeyEventProcessing(e); | 62 return views::Textfield::SkipDefaultKeyEventProcessing(e); |
63 } | 63 } |
64 | 64 |
65 private: | 65 private: |
66 UserController* controller_; | 66 UserController* controller_; |
67 | 67 |
68 DISALLOW_COPY_AND_ASSIGN(UserEntryTextfield); | 68 DISALLOW_COPY_AND_ASSIGN(UserEntryTextfield); |
69 }; | 69 }; |
(...skipping 19 matching lines...) Expand all Loading... |
89 GridLayout::USE_PREF, 0, 0); | 89 GridLayout::USE_PREF, 0, 0); |
90 layout->StartRow(0, 0); | 90 layout->StartRow(0, 0); |
91 layout->AddView(password_field_); | 91 layout->AddView(password_field_); |
92 layout->AddView(submit_button_); | 92 layout->AddView(submit_button_); |
93 SetLayoutManager(layout); | 93 SetLayoutManager(layout); |
94 layout->Layout(this); | 94 layout->Layout(this); |
95 SchedulePaint(); | 95 SchedulePaint(); |
96 } | 96 } |
97 | 97 |
98 } // namespace chromeos | 98 } // namespace chromeos |
OLD | NEW |