Commit d81f2286 authored by chocobo@chromium.org's avatar chocobo@chromium.org

Change show/hide password button image. Changed to ToggleImageButton. Added tooltip to the button.

BUG=chromium-os:17755
TEST=manual
Review URL: http://codereview.chromium.org/7635027

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96604 0039d316-1c4b-4281-b951-d872f2087c98
parent 6536847c
...@@ -10986,6 +10986,12 @@ Keep your key file in a safe place. You will need it to create new versions of y ...@@ -10986,6 +10986,12 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PASSPHRASE" desc="In settings Internet options, the label for the passphrase."> <message name="IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PASSPHRASE" desc="In settings Internet options, the label for the passphrase.">
Password: Password:
</message> </message>
<message name="IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PASSPHRASE_SHOW" desc="In settings Internet options, the label for the passphrase visible toggle button to show passphrase.">
Click to show password
</message>
<message name="IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PASSPHRASE_HIDE" desc="In settings Internet options, the label for the passphrase visible toggle button to hide passphrase.">
Click to hide password
</message>
<message name="IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_SAVE_CREDENTIALS" desc="In settings Internet options, the label for the checkbox to save identity and password."> <message name="IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_SAVE_CREDENTIALS" desc="In settings Internet options, the label for the checkbox to save identity and password.">
Save identity and password Save identity and password
</message> </message>
......
...@@ -483,6 +483,9 @@ ...@@ -483,6 +483,9 @@
<include name="IDR_LOGIN_GUEST" file="login_guest.png" type="BINDATA" /> <include name="IDR_LOGIN_GUEST" file="login_guest.png" type="BINDATA" />
<include name="IDR_LOGIN_ADD_USER" file="login_add_user.png" type="BINDATA" /> <include name="IDR_LOGIN_ADD_USER" file="login_add_user.png" type="BINDATA" />
<include name="IDR_LOGIN_ADD_USER_HOVER" file="login_add_user_hover.png" type="BINDATA" /> <include name="IDR_LOGIN_ADD_USER_HOVER" file="login_add_user_hover.png" type="BINDATA" />
<include name="IDR_NETWORK_SHOW_PASSWORD_OFF" file="network_show_password_off.png" type="BINDATA" />
<include name="IDR_NETWORK_SHOW_PASSWORD_ON" file="network_show_password_on.png" type="BINDATA" />
<include name="IDR_NETWORK_SHOW_PASSWORD_HOVER" file="network_show_password_hover.png" type="BINDATA" />
<include name="IDR_NOTIFICATION_3G" file="notification_3g.png" type="BINDATA" /> <include name="IDR_NOTIFICATION_3G" file="notification_3g.png" type="BINDATA" />
<include name="IDR_NOTIFICATION_BARS_EMPTY" file="notification_bars_empty.png" type="BINDATA" /> <include name="IDR_NOTIFICATION_BARS_EMPTY" file="notification_bars_empty.png" type="BINDATA" />
<include name="IDR_NOTIFICATION_BARS_CRITICAL" file="notification_bars_critical.png" type="BINDATA" /> <include name="IDR_NOTIFICATION_BARS_CRITICAL" file="notification_bars_critical.png" type="BINDATA" />
......
...@@ -494,8 +494,11 @@ bool WifiConfigView::HandleKeyEvent(views::Textfield* sender, ...@@ -494,8 +494,11 @@ bool WifiConfigView::HandleKeyEvent(views::Textfield* sender,
void WifiConfigView::ButtonPressed(views::Button* sender, void WifiConfigView::ButtonPressed(views::Button* sender,
const views::Event& event) { const views::Event& event) {
if (sender == passphrase_visible_button_) { if (sender == passphrase_visible_button_) {
if (passphrase_textfield_) if (passphrase_textfield_) {
passphrase_textfield_->SetPassword(!passphrase_textfield_->IsPassword()); passphrase_textfield_->SetPassword(!passphrase_textfield_->IsPassword());
passphrase_visible_button_->SetToggled(
!passphrase_textfield_->IsPassword());
}
} else { } else {
NOTREACHED(); NOTREACHED();
} }
...@@ -872,11 +875,25 @@ void WifiConfigView::Init(WifiNetwork* wifi, bool show_8021x) { ...@@ -872,11 +875,25 @@ void WifiConfigView::Init(WifiNetwork* wifi, bool show_8021x) {
label_text_id)); label_text_id));
layout->AddView(passphrase_textfield_); layout->AddView(passphrase_textfield_);
// Password visible button. // Password visible button.
passphrase_visible_button_ = new views::ImageButton(this); passphrase_visible_button_ = new views::ToggleImageButton(this);
passphrase_visible_button_->SetTooltipText(
UTF16ToWide(l10n_util::GetStringUTF16(
IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PASSPHRASE_SHOW)));
passphrase_visible_button_->SetToggledTooltipText(
UTF16ToWide(l10n_util::GetStringUTF16(
IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PASSPHRASE_HIDE)));
passphrase_visible_button_->SetImage( passphrase_visible_button_->SetImage(
views::ImageButton::BS_NORMAL, views::ImageButton::BS_NORMAL,
ResourceBundle::GetSharedInstance(). ResourceBundle::GetSharedInstance().
GetBitmapNamed(IDR_STATUSBAR_NETWORK_SECURE)); GetBitmapNamed(IDR_NETWORK_SHOW_PASSWORD_OFF));
passphrase_visible_button_->SetImage(
views::ImageButton::BS_HOT,
ResourceBundle::GetSharedInstance().
GetBitmapNamed(IDR_NETWORK_SHOW_PASSWORD_HOVER));
passphrase_visible_button_->SetToggledImage(
views::ImageButton::BS_NORMAL,
ResourceBundle::GetSharedInstance().
GetBitmapNamed(IDR_NETWORK_SHOW_PASSWORD_ON));
passphrase_visible_button_->SetImageAlignment( passphrase_visible_button_->SetImageAlignment(
views::ImageButton::ALIGN_CENTER, views::ImageButton::ALIGN_MIDDLE); views::ImageButton::ALIGN_CENTER, views::ImageButton::ALIGN_MIDDLE);
layout->AddView(passphrase_visible_button_); layout->AddView(passphrase_visible_button_);
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
namespace views { namespace views {
class Checkbox; class Checkbox;
class ImageButton; class ToggleImageButton;
class Label; class Label;
} }
...@@ -126,7 +126,7 @@ class WifiConfigView : public ChildNetworkConfigView, ...@@ -126,7 +126,7 @@ class WifiConfigView : public ChildNetworkConfigView,
views::Combobox* security_combobox_; views::Combobox* security_combobox_;
views::Label* passphrase_label_; views::Label* passphrase_label_;
views::Textfield* passphrase_textfield_; views::Textfield* passphrase_textfield_;
views::ImageButton* passphrase_visible_button_; views::ToggleImageButton* passphrase_visible_button_;
views::Label* error_label_; views::Label* error_label_;
DISALLOW_COPY_AND_ASSIGN(WifiConfigView); DISALLOW_COPY_AND_ASSIGN(WifiConfigView);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment