| OLD | NEW |
| 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/pdf_tab_helper.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 "chrome/grit/generated_resources.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) |
| 25 #endif // defined(ENABLE_PRINTING) | 26 #endif // defined(ENABLE_PRINTING) |
| 26 | 27 |
| 27 ChromeWebViewGuestDelegate::ChromeWebViewGuestDelegate( | 28 ChromeWebViewGuestDelegate::ChromeWebViewGuestDelegate( |
| 28 extensions::WebViewGuest* web_view_guest) | 29 extensions::WebViewGuest* web_view_guest) |
| 29 : WebViewGuestDelegate(), | 30 : WebViewGuestDelegate(), |
| 30 pending_context_menu_request_id_(0), | 31 pending_context_menu_request_id_(0), |
| 31 chromevox_injected_(false), | 32 chromevox_injected_(false), |
| 32 current_zoom_factor_(1.0), | 33 current_zoom_factor_(1.0), |
| 33 web_view_guest_(web_view_guest) { | 34 web_view_guest_(web_view_guest) { |
| 34 } | 35 } |
| 35 | 36 |
| 36 ChromeWebViewGuestDelegate::~ChromeWebViewGuestDelegate() { | 37 ChromeWebViewGuestDelegate::~ChromeWebViewGuestDelegate() { |
| 37 } | 38 } |
| 38 | 39 |
| 40 int ChromeWebViewGuestDelegate::GetTaskPrefix() const { |
| 41 return IDS_TASK_MANAGER_WEBVIEW_TAG_PREFIX; |
| 42 } |
| 43 |
| 39 double ChromeWebViewGuestDelegate::GetZoom() { | 44 double ChromeWebViewGuestDelegate::GetZoom() { |
| 40 return current_zoom_factor_; | 45 return current_zoom_factor_; |
| 41 } | 46 } |
| 42 | 47 |
| 43 bool ChromeWebViewGuestDelegate::HandleContextMenu( | 48 bool ChromeWebViewGuestDelegate::HandleContextMenu( |
| 44 const content::ContextMenuParams& params) { | 49 const content::ContextMenuParams& params) { |
| 45 ContextMenuDelegate* menu_delegate = | 50 ContextMenuDelegate* menu_delegate = |
| 46 ContextMenuDelegate::FromWebContents(guest_web_contents()); | 51 ContextMenuDelegate::FromWebContents(guest_web_contents()); |
| 47 DCHECK(menu_delegate); | 52 DCHECK(menu_delegate); |
| 48 | 53 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 accessibility_subscription_.reset(); | 200 accessibility_subscription_.reset(); |
| 196 } else if (details.notification_type == | 201 } else if (details.notification_type == |
| 197 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) { | 202 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) { |
| 198 if (details.enabled) | 203 if (details.enabled) |
| 199 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost()); | 204 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost()); |
| 200 else | 205 else |
| 201 chromevox_injected_ = false; | 206 chromevox_injected_ = false; |
| 202 } | 207 } |
| 203 } | 208 } |
| 204 #endif | 209 #endif |
| OLD | NEW |