| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |