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

Side by Side Diff: chrome/browser/ui/views/crypto_module_password_dialog_view.cc

Issue 120503005: Merge NativeTextfieldViews into views::Textfield. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix touch drag and drop unit test. Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/views/crypto_module_password_dialog_view.h" 5 #include "chrome/browser/ui/views/crypto_module_password_dialog_view.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "grit/generated_resources.h" 8 #include "grit/generated_resources.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/events/event.h" 10 #include "ui/events/event.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 54 }
55 55
56 bool CryptoModulePasswordDialogView::Cancel() { 56 bool CryptoModulePasswordDialogView::Cancel() {
57 callback_.Run(std::string()); 57 callback_.Run(std::string());
58 const base::string16 empty; 58 const base::string16 empty;
59 password_entry_->SetText(empty); 59 password_entry_->SetText(empty);
60 return true; 60 return true;
61 } 61 }
62 62
63 bool CryptoModulePasswordDialogView::Accept() { 63 bool CryptoModulePasswordDialogView::Accept() {
64 callback_.Run(base::UTF16ToUTF8(password_entry_->text())); 64 callback_.Run(base::UTF16ToUTF8(password_entry_->GetText()));
65 const base::string16 empty; 65 const base::string16 empty;
66 password_entry_->SetText(empty); 66 password_entry_->SetText(empty);
67 return true; 67 return true;
68 } 68 }
69 69
70 void CryptoModulePasswordDialogView::ContentsChanged( 70 void CryptoModulePasswordDialogView::ContentsChanged(
71 views::Textfield* sender, 71 views::Textfield* sender,
72 const base::string16& new_contents) { 72 const base::string16& new_contents) {
73 } 73 }
74 74
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 CryptoModulePasswordReason reason, 156 CryptoModulePasswordReason reason,
157 const std::string& hostname, 157 const std::string& hostname,
158 gfx::NativeWindow parent, 158 gfx::NativeWindow parent,
159 const CryptoModulePasswordCallback& callback) { 159 const CryptoModulePasswordCallback& callback) {
160 CryptoModulePasswordDialogView* dialog = 160 CryptoModulePasswordDialogView* dialog =
161 new CryptoModulePasswordDialogView(slot_name, reason, hostname, callback); 161 new CryptoModulePasswordDialogView(slot_name, reason, hostname, callback);
162 views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent)->Show(); 162 views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent)->Show();
163 } 163 }
164 164
165 } // namespace chrome 165 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698