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

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/chrome_extension_web_contents_observer.h" 8 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
9 #include "chrome/browser/favicon/favicon_tab_helper.h" 9 #include "chrome/browser/favicon/favicon_tab_helper.h"
10 #include "chrome/browser/guest_view/web_view/web_view_constants.h" 10 #include "chrome/browser/guest_view/web_view/web_view_constants.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_tab_helper_delegate.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_tab_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 18
18 #if defined(ENABLE_PRINTING) 19 #if defined(ENABLE_PRINTING)
19 #if defined(ENABLE_FULL_PRINTING) 20 #if defined(ENABLE_FULL_PRINTING)
20 #include "chrome/browser/printing/print_preview_message_handler.h" 21 #include "chrome/browser/printing/print_preview_message_handler.h"
21 #include "chrome/browser/printing/print_view_manager.h" 22 #include "chrome/browser/printing/print_view_manager.h"
22 #else 23 #else
23 #include "chrome/browser/printing/print_view_manager_basic.h" 24 #include "chrome/browser/printing/print_view_manager_basic.h"
24 #endif // defined(ENABLE_FULL_PRINTING) 25 #endif // defined(ENABLE_FULL_PRINTING)
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 extensions::ChromeExtensionWebContentsObserver:: 78 extensions::ChromeExtensionWebContentsObserver::
78 CreateForWebContents(contents); 79 CreateForWebContents(contents);
79 #if defined(ENABLE_PRINTING) 80 #if defined(ENABLE_PRINTING)
80 #if defined(ENABLE_FULL_PRINTING) 81 #if defined(ENABLE_FULL_PRINTING)
81 printing::PrintViewManager::CreateForWebContents(contents); 82 printing::PrintViewManager::CreateForWebContents(contents);
82 printing::PrintPreviewMessageHandler::CreateForWebContents(contents); 83 printing::PrintPreviewMessageHandler::CreateForWebContents(contents);
83 #else 84 #else
84 printing::PrintViewManagerBasic::CreateForWebContents(contents); 85 printing::PrintViewManagerBasic::CreateForWebContents(contents);
85 #endif // defined(ENABLE_FULL_PRINTING) 86 #endif // defined(ENABLE_FULL_PRINTING)
86 #endif // defined(ENABLE_PRINTING) 87 #endif // defined(ENABLE_PRINTING)
87 PDFTabHelper::CreateForWebContents(contents); 88 pdf::PDFTabHelper::CreateForWebContentsWithDelegate(
89 contents,
90 scoped_ptr<pdf::PDFTabHelperDelegate>(new ChromePDFTabHelperDelegate()));
88 } 91 }
89 92
90 void ChromeWebViewGuestDelegate::OnDidCommitProvisionalLoadForFrame( 93 void ChromeWebViewGuestDelegate::OnDidCommitProvisionalLoadForFrame(
91 bool is_main_frame) { 94 bool is_main_frame) {
92 // Update the current zoom factor for the new page. 95 // Update the current zoom factor for the new page.
93 ZoomController* zoom_controller = 96 ZoomController* zoom_controller =
94 ZoomController::FromWebContents(guest_web_contents()); 97 ZoomController::FromWebContents(guest_web_contents());
95 DCHECK(zoom_controller); 98 DCHECK(zoom_controller);
96 current_zoom_factor_ = zoom_controller->GetZoomLevel(); 99 current_zoom_factor_ = zoom_controller->GetZoomLevel();
97 if (is_main_frame) 100 if (is_main_frame)
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 accessibility_subscription_.reset(); 198 accessibility_subscription_.reset();
196 } else if (details.notification_type == 199 } else if (details.notification_type ==
197 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) { 200 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) {
198 if (details.enabled) 201 if (details.enabled)
199 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost()); 202 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost());
200 else 203 else
201 chromevox_injected_ = false; 204 chromevox_injected_ = false;
202 } 205 }
203 } 206 }
204 #endif 207 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698