Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: chrome/browser/chromeos/login/screen_lock_view.cc

Issue 8748001: Make text input type and password visibility bit independent in Textfield (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Textfield(STYLE_OBSCURED) sets TEXT_INPUT_TYPE_PASSWORD Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/chromeos/login/screen_lock_view.h" 5 #include "chrome/browser/chromeos/login/screen_lock_view.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" 8 #include "chrome/browser/chromeos/login/rounded_rect_painter.h"
9 #include "chrome/browser/chromeos/login/screen_locker.h" 9 #include "chrome/browser/chromeos/login/screen_locker.h"
10 #include "chrome/browser/chromeos/login/textfield_with_margin.h" 10 #include "chrome/browser/chromeos/login/textfield_with_margin.h"
(...skipping 26 matching lines...) Expand all
37 37
38 const int kCornerRadius = 5; 38 const int kCornerRadius = 5;
39 const SkColor kPodBackgroundColor = 0xFFF0F0F0; 39 const SkColor kPodBackgroundColor = 0xFFF0F0F0;
40 40
41 // A Textfield for password, which also sets focus to itself 41 // A Textfield for password, which also sets focus to itself
42 // when a mouse is clicked on it. This is necessary in screen locker 42 // when a mouse is clicked on it. This is necessary in screen locker
43 // as mouse events are grabbed in the screen locker. 43 // as mouse events are grabbed in the screen locker.
44 class PasswordField : public TextfieldWithMargin { 44 class PasswordField : public TextfieldWithMargin {
45 public: 45 public:
46 PasswordField() 46 PasswordField()
47 : TextfieldWithMargin(views::Textfield::STYLE_PASSWORD), 47 : TextfieldWithMargin(views::Textfield::STYLE_OBSCURED),
48 context_menu_disabled_(false) { 48 context_menu_disabled_(false) {
49 set_text_to_display_when_empty( 49 set_text_to_display_when_empty(
50 l10n_util::GetStringUTF16(IDS_LOGIN_POD_EMPTY_PASSWORD_TEXT)); 50 l10n_util::GetStringUTF16(IDS_LOGIN_POD_EMPTY_PASSWORD_TEXT));
51 } 51 }
52 52
53 // views::View overrides. 53 // views::View overrides.
54 virtual bool OnMousePressed(const views::MouseEvent& e) { 54 virtual bool OnMousePressed(const views::MouseEvent& e) {
55 RequestFocus(); 55 RequestFocus();
56 return false; 56 return false;
57 } 57 }
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED || !user_view_) 251 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED || !user_view_)
252 return; 252 return;
253 253
254 User* user = content::Details<User>(details).ptr(); 254 User* user = content::Details<User>(details).ptr();
255 if (screen_locker_->user().email() != user->email()) 255 if (screen_locker_->user().email() != user->email())
256 return; 256 return;
257 user_view_->SetImage(user->image(), user->image()); 257 user_view_->SetImage(user->image(), user->image());
258 } 258 }
259 259
260 } // namespace chromeos 260 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698