| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 PDFWebContentsHelper::~PDFWebContentsHelper() { | 35 PDFWebContentsHelper::~PDFWebContentsHelper() { |
| 36 } | 36 } |
| 37 | 37 |
| 38 void PDFWebContentsHelper::ShowOpenInReaderPrompt( | 38 void PDFWebContentsHelper::ShowOpenInReaderPrompt( |
| 39 std::unique_ptr<OpenPDFInReaderPromptClient> prompt) { | 39 std::unique_ptr<OpenPDFInReaderPromptClient> prompt) { |
| 40 open_in_reader_prompt_ = std::move(prompt); | 40 open_in_reader_prompt_ = std::move(prompt); |
| 41 UpdateLocationBar(); | 41 UpdateLocationBar(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool PDFWebContentsHelper::OnMessageReceived(const IPC::Message& message) { | 44 bool PDFWebContentsHelper::OnMessageReceived( |
| 45 const IPC::Message& message, |
| 46 content::RenderFrameHost* render_frame_host) { |
| 45 bool handled = true; | 47 bool handled = true; |
| 46 IPC_BEGIN_MESSAGE_MAP(PDFWebContentsHelper, message) | 48 IPC_BEGIN_MESSAGE_MAP(PDFWebContentsHelper, message) |
| 47 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFHasUnsupportedFeature, | 49 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFHasUnsupportedFeature, |
| 48 OnHasUnsupportedFeature) | 50 OnHasUnsupportedFeature) |
| 49 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFSaveURLAs, OnSaveURLAs) | 51 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFSaveURLAs, OnSaveURLAs) |
| 50 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFUpdateContentRestrictions, | 52 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFUpdateContentRestrictions, |
| 51 OnUpdateContentRestrictions) | 53 OnUpdateContentRestrictions) |
| 52 IPC_MESSAGE_UNHANDLED(handled = false) | 54 IPC_MESSAGE_UNHANDLED(handled = false) |
| 53 IPC_END_MESSAGE_MAP() | 55 IPC_END_MESSAGE_MAP() |
| 54 return handled; | 56 return handled; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 77 client_->OnSaveURL(web_contents()); | 79 client_->OnSaveURL(web_contents()); |
| 78 web_contents()->SaveFrame(url, referrer); | 80 web_contents()->SaveFrame(url, referrer); |
| 79 } | 81 } |
| 80 | 82 |
| 81 void PDFWebContentsHelper::OnUpdateContentRestrictions( | 83 void PDFWebContentsHelper::OnUpdateContentRestrictions( |
| 82 int content_restrictions) { | 84 int content_restrictions) { |
| 83 client_->UpdateContentRestrictions(web_contents(), content_restrictions); | 85 client_->UpdateContentRestrictions(web_contents(), content_restrictions); |
| 84 } | 86 } |
| 85 | 87 |
| 86 } // namespace pdf | 88 } // namespace pdf |
| OLD | NEW |