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

Side by Side Diff: chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 5
6 #include "chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h" 6 #include "chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h"
7 7
8 #include "chrome/browser/extensions/api/web_request/web_request_api.h" 8 #include "chrome/browser/extensions/api/web_request/web_request_api.h"
9 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" 9 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
10 #include "chrome/browser/favicon/favicon_tab_helper.h" 10 #include "chrome/browser/favicon/favicon_tab_helper.h"
11 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" 11 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
12 #include "chrome/browser/ui/pdf/pdf_tab_helper.h" 12 #include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h"
13 #include "chrome/browser/ui/zoom/zoom_controller.h" 13 #include "chrome/browser/ui/zoom/zoom_controller.h"
14 #include "chrome/common/chrome_version_info.h" 14 #include "chrome/common/chrome_version_info.h"
15 #include "components/pdf/browser/pdf_web_contents_helper.h"
15 #include "components/renderer_context_menu/context_menu_delegate.h" 16 #include "components/renderer_context_menu/context_menu_delegate.h"
16 #include "content/public/common/page_zoom.h" 17 #include "content/public/common/page_zoom.h"
17 #include "extensions/browser/guest_view/web_view/web_view_constants.h" 18 #include "extensions/browser/guest_view/web_view/web_view_constants.h"
18 19
19 #if defined(ENABLE_PRINTING) 20 #if defined(ENABLE_PRINTING)
20 #if defined(ENABLE_FULL_PRINTING) 21 #if defined(ENABLE_FULL_PRINTING)
21 #include "chrome/browser/printing/print_preview_message_handler.h" 22 #include "chrome/browser/printing/print_preview_message_handler.h"
22 #include "chrome/browser/printing/print_view_manager.h" 23 #include "chrome/browser/printing/print_view_manager.h"
23 #else 24 #else
24 #include "chrome/browser/printing/print_view_manager_basic.h" 25 #include "chrome/browser/printing/print_view_manager_basic.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 extensions::ChromeExtensionWebContentsObserver:: 114 extensions::ChromeExtensionWebContentsObserver::
114 CreateForWebContents(contents); 115 CreateForWebContents(contents);
115 #if defined(ENABLE_PRINTING) 116 #if defined(ENABLE_PRINTING)
116 #if defined(ENABLE_FULL_PRINTING) 117 #if defined(ENABLE_FULL_PRINTING)
117 printing::PrintViewManager::CreateForWebContents(contents); 118 printing::PrintViewManager::CreateForWebContents(contents);
118 printing::PrintPreviewMessageHandler::CreateForWebContents(contents); 119 printing::PrintPreviewMessageHandler::CreateForWebContents(contents);
119 #else 120 #else
120 printing::PrintViewManagerBasic::CreateForWebContents(contents); 121 printing::PrintViewManagerBasic::CreateForWebContents(contents);
121 #endif // defined(ENABLE_FULL_PRINTING) 122 #endif // defined(ENABLE_FULL_PRINTING)
122 #endif // defined(ENABLE_PRINTING) 123 #endif // defined(ENABLE_PRINTING)
123 PDFTabHelper::CreateForWebContents(contents); 124 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(
125 contents,
126 scoped_ptr<pdf::PDFWebContentsHelperClient>(
127 new ChromePDFWebContentsHelperClient()));
124 } 128 }
125 129
126 void ChromeWebViewGuestDelegate::OnEmbedderDestroyed() { 130 void ChromeWebViewGuestDelegate::OnEmbedderDestroyed() {
127 // TODO(fsamuel): WebRequest event listeners for <webview> should survive 131 // TODO(fsamuel): WebRequest event listeners for <webview> should survive
128 // reparenting of a <webview> within a single embedder. Right now, we keep 132 // reparenting of a <webview> within a single embedder. Right now, we keep
129 // around the browser state for the listener for the lifetime of the embedder. 133 // around the browser state for the listener for the lifetime of the embedder.
130 // Ideally, the lifetime of the listeners should match the lifetime of the 134 // Ideally, the lifetime of the listeners should match the lifetime of the
131 // <webview> DOM node. Once http://crbug.com/156219 is resolved we can move 135 // <webview> DOM node. Once http://crbug.com/156219 is resolved we can move
132 // the call to RemoveWebViewEventListenersOnIOThread back to 136 // the call to RemoveWebViewEventListenersOnIOThread back to
133 // WebViewGuest::WebContentsDestroyed. 137 // WebViewGuest::WebContentsDestroyed.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 accessibility_subscription_.reset(); 261 accessibility_subscription_.reset();
258 } else if (details.notification_type == 262 } else if (details.notification_type ==
259 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) { 263 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) {
260 if (details.enabled) 264 if (details.enabled)
261 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost()); 265 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost());
262 else 266 else
263 chromevox_injected_ = false; 267 chromevox_injected_ = false;
264 } 268 }
265 } 269 }
266 #endif 270 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698