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

Unified Diff: chrome/browser/ui/views/crypto_module_password_dialog_view.cc

Issue 9956157: views: Make everything in crypto module password dialog private except the ctor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: peter view Created 8 years, 8 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/crypto_module_password_dialog_view.cc
diff --git a/chrome/browser/ui/views/crypto_module_password_dialog_view.cc b/chrome/browser/ui/views/crypto_module_password_dialog_view.cc
index fb436f9279d94000171f477882dd24b4406a78c2..6a1eb031e7744ee7d82282cbcb612c81d940666a 100644
--- a/chrome/browser/ui/views/crypto_module_password_dialog_view.cc
+++ b/chrome/browser/ui/views/crypto_module_password_dialog_view.cc
@@ -4,11 +4,7 @@
#include "chrome/browser/ui/views/crypto_module_password_dialog_view.h"
-#include "base/basictypes.h"
-#include "base/bind.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/ui/views/window.h"
-#include "googleurl/src/gurl.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/controls/button/text_button.h"
@@ -20,13 +16,14 @@
namespace browser {
-// CryptoModulePasswordDialogView
////////////////////////////////////////////////////////////////////////////////
+// CryptoModulePasswordDialogView, public:
+
CryptoModulePasswordDialogView::CryptoModulePasswordDialogView(
const std::string& slot_name,
- browser::CryptoModulePasswordReason reason,
+ CryptoModulePasswordReason reason,
const std::string& server,
- const base::Callback<void(const char*)>& callback)
+ const CryptoModulePasswordCallback& callback)
: callback_(callback) {
Init(server, slot_name, reason);
}
@@ -34,10 +31,59 @@ CryptoModulePasswordDialogView::CryptoModulePasswordDialogView(
CryptoModulePasswordDialogView::~CryptoModulePasswordDialogView() {
}
-void CryptoModulePasswordDialogView::Init(
- const std::string& server,
- const std::string& slot_name,
- browser::CryptoModulePasswordReason reason) {
+////////////////////////////////////////////////////////////////////////////////
+// CryptoModulePasswordDialogView, private:
+
+views::View* CryptoModulePasswordDialogView::GetInitiallyFocusedView() {
+ return password_entry_;
+}
+
+ui::ModalType CryptoModulePasswordDialogView::GetModalType() const {
+ return ui::MODAL_TYPE_WINDOW;
+}
+
+string16 CryptoModulePasswordDialogView::GetWindowTitle() const {
+ return l10n_util::GetStringUTF16(IDS_CRYPTO_MODULE_AUTH_DIALOG_TITLE);
+}
+
+views::View* CryptoModulePasswordDialogView::GetContentsView() {
+ return this;
+}
+
+string16 CryptoModulePasswordDialogView::GetDialogButtonLabel(
+ ui::DialogButton button) const {
+ return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK ?
+ IDS_CRYPTO_MODULE_AUTH_DIALOG_OK_BUTTON_LABEL : IDS_CANCEL);
+}
+
+bool CryptoModulePasswordDialogView::Cancel() {
+ callback_.Run(static_cast<const char*>(NULL));
+ const string16 empty;
+ password_entry_->SetText(empty);
+ return true;
+}
+
+bool CryptoModulePasswordDialogView::Accept() {
+ callback_.Run(UTF16ToUTF8(password_entry_->text()).c_str());
+ const string16 empty;
+ password_entry_->SetText(empty);
+ return true;
+}
+
+void CryptoModulePasswordDialogView::ContentsChanged(
+ views::Textfield* sender,
+ const string16& new_contents) {
+}
+
+bool CryptoModulePasswordDialogView::HandleKeyEvent(
+ views::Textfield* sender,
+ const views::KeyEvent& keystroke) {
+ return false;
+}
+
+void CryptoModulePasswordDialogView::Init(const std::string& server,
+ const std::string& slot_name,
+ CryptoModulePasswordReason reason) {
// Select an appropriate text for the reason.
std::string text;
const string16& server16 = UTF8ToUTF16(server);
@@ -105,53 +151,6 @@ void CryptoModulePasswordDialogView::Init(
layout->AddView(password_entry_);
}
-views::View* CryptoModulePasswordDialogView::GetInitiallyFocusedView() {
- return password_entry_;
-}
-
-ui::ModalType CryptoModulePasswordDialogView::GetModalType() const {
- return ui::MODAL_TYPE_WINDOW;
-}
-
-views::View* CryptoModulePasswordDialogView::GetContentsView() {
- return this;
-}
-
-string16 CryptoModulePasswordDialogView::GetDialogButtonLabel(
- ui::DialogButton button) const {
- return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK ?
- IDS_CRYPTO_MODULE_AUTH_DIALOG_OK_BUTTON_LABEL : IDS_CANCEL);
-}
-
-bool CryptoModulePasswordDialogView::Accept() {
- callback_.Run(UTF16ToUTF8(password_entry_->text()).c_str());
- const string16 empty;
- password_entry_->SetText(empty);
- return true;
-}
-
-bool CryptoModulePasswordDialogView::Cancel() {
- callback_.Run(static_cast<const char*>(NULL));
- const string16 empty;
- password_entry_->SetText(empty);
- return true;
-}
-
-bool CryptoModulePasswordDialogView::HandleKeyEvent(
- views::Textfield* sender,
- const views::KeyEvent& keystroke) {
- return false;
-}
-
-void CryptoModulePasswordDialogView::ContentsChanged(
- views::Textfield* sender,
- const string16& new_contents) {
-}
-
-string16 CryptoModulePasswordDialogView::GetWindowTitle() const {
- return l10n_util::GetStringUTF16(IDS_CRYPTO_MODULE_AUTH_DIALOG_TITLE);
-}
-
void ShowCryptoModulePasswordDialog(
const std::string& slot_name,
bool retry,

Powered by Google App Engine
This is Rietveld 408576698