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

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

Issue 1548203002: Convert Pass()→std::move() in //components/[n-z]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad headers Created 4 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
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>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
9 #include "components/pdf/browser/open_pdf_in_reader_prompt_client.h" 11 #include "components/pdf/browser/open_pdf_in_reader_prompt_client.h"
10 #include "components/pdf/browser/pdf_web_contents_helper_client.h" 12 #include "components/pdf/browser/pdf_web_contents_helper_client.h"
11 #include "components/pdf/common/pdf_messages.h" 13 #include "components/pdf/common/pdf_messages.h"
12 #include "content/public/browser/navigation_details.h" 14 #include "content/public/browser/navigation_details.h"
13 15
14 DEFINE_WEB_CONTENTS_USER_DATA_KEY(pdf::PDFWebContentsHelper); 16 DEFINE_WEB_CONTENTS_USER_DATA_KEY(pdf::PDFWebContentsHelper);
15 17
16 namespace pdf { 18 namespace pdf {
17 19
18 // static 20 // static
19 void PDFWebContentsHelper::CreateForWebContentsWithClient( 21 void PDFWebContentsHelper::CreateForWebContentsWithClient(
20 content::WebContents* contents, 22 content::WebContents* contents,
21 scoped_ptr<PDFWebContentsHelperClient> client) { 23 scoped_ptr<PDFWebContentsHelperClient> client) {
22 if (FromWebContents(contents)) 24 if (FromWebContents(contents))
23 return; 25 return;
24 contents->SetUserData(UserDataKey(), 26 contents->SetUserData(UserDataKey(),
25 new PDFWebContentsHelper(contents, client.Pass())); 27 new PDFWebContentsHelper(contents, std::move(client)));
26 } 28 }
27 29
28 PDFWebContentsHelper::PDFWebContentsHelper( 30 PDFWebContentsHelper::PDFWebContentsHelper(
29 content::WebContents* web_contents, 31 content::WebContents* web_contents,
30 scoped_ptr<PDFWebContentsHelperClient> client) 32 scoped_ptr<PDFWebContentsHelperClient> client)
31 : content::WebContentsObserver(web_contents), client_(client.Pass()) { 33 : content::WebContentsObserver(web_contents), client_(std::move(client)) {}
32 }
33 34
34 PDFWebContentsHelper::~PDFWebContentsHelper() { 35 PDFWebContentsHelper::~PDFWebContentsHelper() {
35 } 36 }
36 37
37 void PDFWebContentsHelper::ShowOpenInReaderPrompt( 38 void PDFWebContentsHelper::ShowOpenInReaderPrompt(
38 scoped_ptr<OpenPDFInReaderPromptClient> prompt) { 39 scoped_ptr<OpenPDFInReaderPromptClient> prompt) {
39 open_in_reader_prompt_ = prompt.Pass(); 40 open_in_reader_prompt_ = std::move(prompt);
40 UpdateLocationBar(); 41 UpdateLocationBar();
41 } 42 }
42 43
43 bool PDFWebContentsHelper::OnMessageReceived(const IPC::Message& message) { 44 bool PDFWebContentsHelper::OnMessageReceived(const IPC::Message& message) {
44 bool handled = true; 45 bool handled = true;
45 IPC_BEGIN_MESSAGE_MAP(PDFWebContentsHelper, message) 46 IPC_BEGIN_MESSAGE_MAP(PDFWebContentsHelper, message)
46 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFHasUnsupportedFeature, 47 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFHasUnsupportedFeature,
47 OnHasUnsupportedFeature) 48 OnHasUnsupportedFeature)
48 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFSaveURLAs, OnSaveURLAs) 49 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFSaveURLAs, OnSaveURLAs)
49 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFUpdateContentRestrictions, 50 IPC_MESSAGE_HANDLER(PDFHostMsg_PDFUpdateContentRestrictions,
(...skipping 26 matching lines...) Expand all
76 client_->OnSaveURL(web_contents()); 77 client_->OnSaveURL(web_contents());
77 web_contents()->SaveFrame(url, referrer); 78 web_contents()->SaveFrame(url, referrer);
78 } 79 }
79 80
80 void PDFWebContentsHelper::OnUpdateContentRestrictions( 81 void PDFWebContentsHelper::OnUpdateContentRestrictions(
81 int content_restrictions) { 82 int content_restrictions) {
82 client_->UpdateContentRestrictions(web_contents(), content_restrictions); 83 client_->UpdateContentRestrictions(web_contents(), content_restrictions);
83 } 84 }
84 85
85 } // namespace pdf 86 } // namespace pdf
OLDNEW
« no previous file with comments | « components/password_manager/sync/browser/sync_credentials_filter_unittest.cc ('k') | components/pdf_viewer/pdf_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698