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

Side by Side Diff: chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.cc

Issue 477263003: pdf: Create a separate component for using the pdf pepper plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 3 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h"
6
7 #include "chrome/browser/download/download_stats.h"
8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_finder.h"
10 #include "chrome/browser/ui/browser_window.h"
11 #include "chrome/browser/ui/location_bar/location_bar.h"
12 #include "chrome/browser/ui/pdf/pdf_unsupported_feature.h"
13 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
14
15 ChromePDFWebContentsHelperClient::ChromePDFWebContentsHelperClient() {
16 }
17
18 ChromePDFWebContentsHelperClient::~ChromePDFWebContentsHelperClient() {
19 }
20
21 void ChromePDFWebContentsHelperClient::UpdateLocationBar(
22 content::WebContents* contents) {
23 Browser* browser = chrome::FindBrowserWithWebContents(contents);
24 if (!browser)
25 return;
26
27 BrowserWindow* window = browser->window();
28 if (!window)
29 return;
30
31 LocationBar* location_bar = window->GetLocationBar();
32 if (!location_bar)
33 return;
34
35 location_bar->UpdateOpenPDFInReaderPrompt();
36 }
37
38 void ChromePDFWebContentsHelperClient::UpdateContentRestrictions(
39 content::WebContents* contents,
40 int content_restrictions) {
41 CoreTabHelper* core_tab_helper = CoreTabHelper::FromWebContents(contents);
42 // |core_tab_helper| is NULL for WebViewGuest.
43 if (core_tab_helper)
44 core_tab_helper->UpdateContentRestrictions(content_restrictions);
45 }
46
47 void ChromePDFWebContentsHelperClient::OnPDFHasUnsupportedFeature(
48 content::WebContents* contents) {
49 PDFHasUnsupportedFeature(contents);
50 }
51
52 void ChromePDFWebContentsHelperClient::OnSaveURL(
53 content::WebContents* contents) {
54 RecordDownloadSource(DOWNLOAD_INITIATED_BY_PDF_SAVE);
55 }
56
57 void ChromePDFWebContentsHelperClient::OnShowPDFPasswordDialog(
58 content::WebContents* contents,
59 const base::string16& prompt,
60 const pdf::PasswordDialogClosedCallback& callback) {
61 ShowPDFPasswordDialog(contents, prompt, callback);
62 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698