diff options
-rw-r--r-- | chrome/browser/chromeos/options/internet_page_view.cc | 1 | ||||
-rw-r--r-- | chrome/browser/chromeos/status/password_dialog_view.cc | 62 | ||||
-rw-r--r-- | chrome/browser/chromeos/status/password_dialog_view.h | 72 | ||||
-rwxr-xr-x | chrome/chrome_browser.gypi | 2 |
4 files changed, 0 insertions, 137 deletions
diff --git a/chrome/browser/chromeos/options/internet_page_view.cc b/chrome/browser/chromeos/options/internet_page_view.cc index 4e517a9..2b021ba 100644 --- a/chrome/browser/chromeos/options/internet_page_view.cc +++ b/chrome/browser/chromeos/options/internet_page_view.cc @@ -10,7 +10,6 @@ #include "chrome/browser/chromeos/cros/network_library.h" #include "chrome/browser/chromeos/options/network_config_view.h" #include "chrome/browser/chromeos/status/network_menu_button.h" -#include "chrome/browser/chromeos/status/password_dialog_view.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "views/controls/button/native_button.h" diff --git a/chrome/browser/chromeos/status/password_dialog_view.cc b/chrome/browser/chromeos/status/password_dialog_view.cc deleted file mode 100644 index 22cf8f4..0000000 --- a/chrome/browser/chromeos/status/password_dialog_view.cc +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/chromeos/status/password_dialog_view.h" - -#include "app/l10n_util.h" -#include "grit/chromium_strings.h" -#include "grit/generated_resources.h" -#include "grit/locale_settings.h" -#include "views/controls/textfield/textfield.h" -#include "views/grid_layout.h" -#include "views/standard_layout.h" -#include "views/window/window.h" - -namespace chromeos { - -PasswordDialogView::PasswordDialogView(PasswordDialogDelegate* delegate, - const std::string& ssid) - : delegate_(delegate), - ssid_(ssid), - password_textfield_(NULL) { - Init(); -} - -bool PasswordDialogView::Cancel() { - return delegate_->OnPasswordDialogCancel(); -} - -bool PasswordDialogView::Accept() { - // TODO(chocobo): We should not need to call SyncText ourself here. - password_textfield_->SyncText(); - return delegate_->OnPasswordDialogAccept(ssid_, password_textfield_->text()); -} - -std::wstring PasswordDialogView::GetWindowTitle() const { - return l10n_util::GetString(IDS_OPTIONS_SETTINGS_SECTION_TITLE_PASSWORD); -} - -gfx::Size PasswordDialogView::GetPreferredSize() { - // TODO(chocobo): Create our own localized content size once the UI is done. - return gfx::Size(views::Window::GetLocalizedContentsSize( - IDS_IMPORTLOCK_DIALOG_WIDTH_CHARS, - IDS_IMPORTLOCK_DIALOG_HEIGHT_LINES)); -} - -void PasswordDialogView::Init() { - views::GridLayout* layout = CreatePanelGridLayout(this); - SetLayoutManager(layout); - - int column_view_set_id = 0; - views::ColumnSet* column_set = layout->AddColumnSet(column_view_set_id); - column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, - views::GridLayout::USE_PREF, 0, 200); - - layout->StartRow(0, column_view_set_id); - password_textfield_ = new views::Textfield(views::Textfield::STYLE_PASSWORD); - layout->AddView(password_textfield_); - layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); -} - -} // namespace chromeos diff --git a/chrome/browser/chromeos/status/password_dialog_view.h b/chrome/browser/chromeos/status/password_dialog_view.h deleted file mode 100644 index e76f632..0000000 --- a/chrome/browser/chromeos/status/password_dialog_view.h +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_CHROMEOS_STATUS_PASSWORD_DIALOG_VIEW_H_ -#define CHROME_BROWSER_CHROMEOS_STATUS_PASSWORD_DIALOG_VIEW_H_ - -#include <string> - -#include "base/string16.h" -#include "views/window/dialog_delegate.h" - -namespace views { -class Textfield; -class View; -class Window; -} - -namespace chromeos { - -// Delegate implemented by caller of PasswordDialogView to handle the user -// interacting with the dialog box. -class PasswordDialogDelegate { - public: - // Called when user clicks on cancel button. - // Return whether or not to allow password dialog to close. - virtual bool OnPasswordDialogCancel() = 0; - - // Called when user clicks on ok with a password. - // Return whether or not to allow password dialog to close. - virtual bool OnPasswordDialogAccept(const std::string& ssid, - const string16& password) = 0; -}; - -// A dialog box for showing a password textfield. -class PasswordDialogView : public views::View, - public views::DialogDelegate { - public: - explicit PasswordDialogView(PasswordDialogDelegate* delegate, - const std::string& ssid); - virtual ~PasswordDialogView() {} - - // views::DialogDelegate methods. - virtual bool Cancel(); - virtual bool Accept(); - - // views::WindowDelegate method. - virtual bool IsModal() const { return true; } - virtual views::View* GetContentsView() { return this; } - - // views::View overrides. - virtual std::wstring GetWindowTitle() const; - virtual gfx::Size GetPreferredSize(); - - private: - void Init(); - - // Used for call back to delegate that password has been entered. - PasswordDialogDelegate* delegate_; - - // The ssid we are requesting the password for. - std::string ssid_; - - // Combobox and its corresponding model. - views::Textfield* password_textfield_; - - DISALLOW_COPY_AND_ASSIGN(PasswordDialogView); -}; - -} // namespace chromeos - -#endif // CHROME_BROWSER_CHROMEOS_STATUS_PASSWORD_DIALOG_VIEW_H_ diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 49463ca..af3fcb8 100755 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -411,8 +411,6 @@ 'browser/chromeos/status/language_menu_button.h', 'browser/chromeos/status/network_menu_button.cc', 'browser/chromeos/status/network_menu_button.h', - 'browser/chromeos/status/password_dialog_view.cc', - 'browser/chromeos/status/password_dialog_view.h', 'browser/chromeos/status/power_menu_button.cc', 'browser/chromeos/status/power_menu_button.h', 'browser/chromeos/status/status_area_button.cc', |