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

Side by Side Diff: chrome/browser/ui/views/pdf_password_dialog.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/pdf/pdf_tab_helper.h" 5 #include "chrome/browser/ui/pdf/pdf_tab_helper.h"
6 6
7 #include "chrome/browser/ui/views/constrained_window_views.h" 7 #include "chrome/browser/ui/views/constrained_window_views.h"
8 #include "components/web_modal/web_contents_modal_dialog_host.h" 8 #include "components/web_modal/web_contents_modal_dialog_host.h"
9 #include "components/web_modal/web_contents_modal_dialog_manager.h" 9 #include "components/web_modal/web_contents_modal_dialog_manager.h"
10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" 10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 return base::string16(); 107 return base::string16();
108 } 108 }
109 109
110 bool PDFPasswordDialogViews::Cancel() { 110 bool PDFPasswordDialogViews::Cancel() {
111 callback_.Run(false, base::string16()); 111 callback_.Run(false, base::string16());
112 callback_.Reset(); 112 callback_.Reset();
113 return true; 113 return true;
114 } 114 }
115 115
116 bool PDFPasswordDialogViews::Accept() { 116 bool PDFPasswordDialogViews::Accept() {
117 callback_.Run(true, message_box_view_->text_box()->text()); 117 callback_.Run(true, message_box_view_->text_box()->GetText());
118 callback_.Reset(); 118 callback_.Reset();
119 return true; 119 return true;
120 } 120 }
121 121
122 /////////////////////////////////////////////////////////////////////////////// 122 ///////////////////////////////////////////////////////////////////////////////
123 // PDFPasswordDialogViews, views::WidgetDelegate implementation: 123 // PDFPasswordDialogViews, views::WidgetDelegate implementation:
124 124
125 views::View* PDFPasswordDialogViews::GetInitiallyFocusedView() { 125 views::View* PDFPasswordDialogViews::GetInitiallyFocusedView() {
126 return message_box_view_->text_box(); 126 return message_box_view_->text_box();
127 } 127 }
(...skipping 29 matching lines...) Expand all
157 #endif 157 #endif
158 } 158 }
159 159
160 } // namespace 160 } // namespace
161 161
162 void ShowPDFPasswordDialog(content::WebContents* web_contents, 162 void ShowPDFPasswordDialog(content::WebContents* web_contents,
163 const base::string16& prompt, 163 const base::string16& prompt,
164 const PasswordDialogClosedCallback& callback) { 164 const PasswordDialogClosedCallback& callback) {
165 new PDFPasswordDialogViews(web_contents, prompt, callback); 165 new PDFPasswordDialogViews(web_contents, prompt, callback);
166 } 166 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698