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

Side by Side Diff: components/pdf/browser/pdf_web_contents_helper.cc

Issue 2252573003: Add PDFExtensionTest.DownloadPDFButton Base URL: https://chromium.googlesource.com/chromium/src.git@bug_638087
Patch Set: missing changes Created 4 years, 4 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
« no previous file with comments | « components/pdf/browser/pdf_web_contents_helper.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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 void PDFWebContentsHelper::SetClientForTest(
45 std::unique_ptr<PDFWebContentsHelperClient> client) {
46 client_ = std::move(client);
47 }
48
44 bool PDFWebContentsHelper::OnMessageReceived( 49 bool PDFWebContentsHelper::OnMessageReceived(
45 const IPC::Message& message, 50 const IPC::Message& message,
46 content::RenderFrameHost* render_frame_host) { 51 content::RenderFrameHost* render_frame_host) {
47 bool handled = true; 52 bool handled = true;
48 IPC_BEGIN_MESSAGE_MAP(PDFWebContentsHelper, message) 53 IPC_BEGIN_MESSAGE_MAP(PDFWebContentsHelper, message)
49 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFHasUnsupportedFeature, 54 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFHasUnsupportedFeature,
50 OnHasUnsupportedFeature) 55 OnHasUnsupportedFeature)
51 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFSaveURLAs, OnSaveURLAs) 56 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFSaveURLAs, OnSaveURLAs)
52 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFUpdateContentRestrictions, 57 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFUpdateContentRestrictions,
53 OnUpdateContentRestrictions) 58 OnUpdateContentRestrictions)
(...skipping 25 matching lines...) Expand all
79 client_->OnSaveURL(web_contents()); 84 client_->OnSaveURL(web_contents());
80 web_contents()->SaveFrame(url, referrer); 85 web_contents()->SaveFrame(url, referrer);
81 } 86 }
82 87
83 void PDFWebContentsHelper::OnUpdateContentRestrictions( 88 void PDFWebContentsHelper::OnUpdateContentRestrictions(
84 int content_restrictions) { 89 int content_restrictions) {
85 client_->UpdateContentRestrictions(web_contents(), content_restrictions); 90 client_->UpdateContentRestrictions(web_contents(), content_restrictions);
86 } 91 }
87 92
88 } // namespace pdf 93 } // namespace pdf
OLDNEW
« no previous file with comments | « components/pdf/browser/pdf_web_contents_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698