| OLD | NEW |
| 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 "components/pdf/browser/pdf_web_contents_helper.h" | 5 #include "components/pdf/browser/pdf_web_contents_helper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "components/pdf/browser/open_pdf_in_reader_prompt_client.h" | 9 #include "components/pdf/browser/open_pdf_in_reader_prompt_client.h" |
| 10 #include "components/pdf/browser/pdf_web_contents_helper_client.h" | 10 #include "components/pdf/browser/pdf_web_contents_helper_client.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 void PDFWebContentsHelper::UpdateLocationBar() { | 68 void PDFWebContentsHelper::UpdateLocationBar() { |
| 69 client_->UpdateLocationBar(web_contents()); | 69 client_->UpdateLocationBar(web_contents()); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void PDFWebContentsHelper::OnHasUnsupportedFeature() { | 72 void PDFWebContentsHelper::OnHasUnsupportedFeature() { |
| 73 client_->OnPDFHasUnsupportedFeature(web_contents()); | 73 client_->OnPDFHasUnsupportedFeature(web_contents()); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void PDFWebContentsHelper::OnSaveURLAs(const GURL& url, | 76 void PDFWebContentsHelper::OnSaveURLAs(const GURL& url, |
| 77 const content::Referrer& referrer) { | 77 const content::Referrer& referrer) { |
| 78 //CHECK(0); |
| 78 client_->OnSaveURL(web_contents()); | 79 client_->OnSaveURL(web_contents()); |
| 79 web_contents()->SaveFrame(url, referrer); | 80 web_contents()->SaveFrame(url, referrer); |
| 80 } | 81 } |
| 81 | 82 |
| 82 void PDFWebContentsHelper::OnUpdateContentRestrictions( | 83 void PDFWebContentsHelper::OnUpdateContentRestrictions( |
| 83 int content_restrictions) { | 84 int content_restrictions) { |
| 84 client_->UpdateContentRestrictions(web_contents(), content_restrictions); | 85 client_->UpdateContentRestrictions(web_contents(), content_restrictions); |
| 85 } | 86 } |
| 86 | 87 |
| 87 void PDFWebContentsHelper::OnModalPromptForPasswordClosed( | 88 void PDFWebContentsHelper::OnModalPromptForPasswordClosed( |
| (...skipping 10 matching lines...) Expand all Loading... |
| 98 IPC::Message* reply_message) { | 99 IPC::Message* reply_message) { |
| 99 base::Callback<void(bool, const base::string16&)> callback = | 100 base::Callback<void(bool, const base::string16&)> callback = |
| 100 base::Bind(&PDFWebContentsHelper::OnModalPromptForPasswordClosed, | 101 base::Bind(&PDFWebContentsHelper::OnModalPromptForPasswordClosed, |
| 101 base::Unretained(this), | 102 base::Unretained(this), |
| 102 reply_message); | 103 reply_message); |
| 103 client_->OnShowPDFPasswordDialog( | 104 client_->OnShowPDFPasswordDialog( |
| 104 web_contents(), base::UTF8ToUTF16(prompt), callback); | 105 web_contents(), base::UTF8ToUTF16(prompt), callback); |
| 105 } | 106 } |
| 106 | 107 |
| 107 } // namespace pdf | 108 } // namespace pdf |
| OLD | NEW |