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

Side by Side Diff: chrome/renderer/printing/chrome_print_web_view_helper_delegate.cc

Issue 2478573004: Convert GURL::{host,path} to GURL::{host_piece,path_piece} for ==. (Closed)
Patch Set: rebase to #431874 Created 4 years, 1 month 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 | « chrome/common/search/search_urls.cc ('k') | chrome/utility/importer/bookmarks_file_importer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/renderer/printing/chrome_print_web_view_helper_delegate.h" 5 #include "chrome/renderer/printing/chrome_print_web_view_helper_delegate.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 27 matching lines...) Expand all
38 return render_view->Send( 38 return render_view->Send(
39 new ChromeViewHostMsg_CancelPrerenderForPrinting(routing_id)); 39 new ChromeViewHostMsg_CancelPrerenderForPrinting(routing_id));
40 } 40 }
41 41
42 // Return the PDF object element if |frame| is the out of process PDF extension. 42 // Return the PDF object element if |frame| is the out of process PDF extension.
43 blink::WebElement ChromePrintWebViewHelperDelegate::GetPdfElement( 43 blink::WebElement ChromePrintWebViewHelperDelegate::GetPdfElement(
44 blink::WebLocalFrame* frame) { 44 blink::WebLocalFrame* frame) {
45 #if BUILDFLAG(ENABLE_EXTENSIONS) 45 #if BUILDFLAG(ENABLE_EXTENSIONS)
46 GURL url = frame->document().url(); 46 GURL url = frame->document().url();
47 bool inside_print_preview = url.GetOrigin() == chrome::kChromeUIPrintURL; 47 bool inside_print_preview = url.GetOrigin() == chrome::kChromeUIPrintURL;
48 bool inside_pdf_extension = url.SchemeIs(extensions::kExtensionScheme) && 48 bool inside_pdf_extension =
49 url.host() == extension_misc::kPdfExtensionId; 49 url.SchemeIs(extensions::kExtensionScheme) &&
50 url.host_piece() == extension_misc::kPdfExtensionId;
50 if (inside_print_preview || inside_pdf_extension) { 51 if (inside_print_preview || inside_pdf_extension) {
51 // <object> with id="plugin" is created in 52 // <object> with id="plugin" is created in
52 // chrome/browser/resources/pdf/pdf.js. 53 // chrome/browser/resources/pdf/pdf.js.
53 auto plugin_element = frame->document().getElementById("plugin"); 54 auto plugin_element = frame->document().getElementById("plugin");
54 if (!plugin_element.isNull()) { 55 if (!plugin_element.isNull()) {
55 return plugin_element; 56 return plugin_element;
56 } 57 }
57 NOTREACHED(); 58 NOTREACHED();
58 } 59 }
59 #endif // BUILDFLAG(ENABLE_EXTENSIONS) 60 #endif // BUILDFLAG(ENABLE_EXTENSIONS)
(...skipping 20 matching lines...) Expand all
80 // PDF plugin document correctly print the PDF. See 81 // PDF plugin document correctly print the PDF. See
81 // https://crbug.com/448720. 82 // https://crbug.com/448720.
82 base::DictionaryValue message; 83 base::DictionaryValue message;
83 message.SetString("type", "print"); 84 message.SetString("type", "print");
84 mime_handlers.front()->PostMessageFromValue(message); 85 mime_handlers.front()->PostMessageFromValue(message);
85 return true; 86 return true;
86 } 87 }
87 #endif // BUILDFLAG(ENABLE_EXTENSIONS) 88 #endif // BUILDFLAG(ENABLE_EXTENSIONS)
88 return false; 89 return false;
89 } 90 }
OLDNEW
« no previous file with comments | « chrome/common/search/search_urls.cc ('k') | chrome/utility/importer/bookmarks_file_importer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698