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/task_manager/task_manager_util.h" |
12 #include "chrome/browser/ui/pdf/pdf_tab_helper.h" | 13 #include "chrome/browser/ui/pdf/pdf_tab_helper.h" |
13 #include "chrome/browser/ui/zoom/zoom_controller.h" | 14 #include "chrome/browser/ui/zoom/zoom_controller.h" |
14 #include "chrome/common/chrome_version_info.h" | 15 #include "chrome/common/chrome_version_info.h" |
| 16 #include "chrome/grit/generated_resources.h" |
15 #include "components/renderer_context_menu/context_menu_delegate.h" | 17 #include "components/renderer_context_menu/context_menu_delegate.h" |
16 #include "content/public/common/page_zoom.h" | 18 #include "content/public/common/page_zoom.h" |
| 19 #include "ui/base/l10n/l10n_util.h" |
17 | 20 |
18 #if defined(ENABLE_PRINTING) | 21 #if defined(ENABLE_PRINTING) |
19 #if defined(ENABLE_FULL_PRINTING) | 22 #if defined(ENABLE_FULL_PRINTING) |
20 #include "chrome/browser/printing/print_preview_message_handler.h" | 23 #include "chrome/browser/printing/print_preview_message_handler.h" |
21 #include "chrome/browser/printing/print_view_manager.h" | 24 #include "chrome/browser/printing/print_view_manager.h" |
22 #else | 25 #else |
23 #include "chrome/browser/printing/print_view_manager_basic.h" | 26 #include "chrome/browser/printing/print_view_manager_basic.h" |
24 #endif // defined(ENABLE_FULL_PRINTING) | 27 #endif // defined(ENABLE_FULL_PRINTING) |
25 #endif // defined(ENABLE_PRINTING) | 28 #endif // defined(ENABLE_PRINTING) |
26 | 29 |
27 ChromeWebViewGuestDelegate::ChromeWebViewGuestDelegate( | 30 ChromeWebViewGuestDelegate::ChromeWebViewGuestDelegate( |
28 extensions::WebViewGuest* web_view_guest) | 31 extensions::WebViewGuest* web_view_guest) |
29 : WebViewGuestDelegate(), | 32 : WebViewGuestDelegate(), |
30 pending_context_menu_request_id_(0), | 33 pending_context_menu_request_id_(0), |
31 chromevox_injected_(false), | 34 chromevox_injected_(false), |
32 current_zoom_factor_(1.0), | 35 current_zoom_factor_(1.0), |
33 web_view_guest_(web_view_guest) { | 36 web_view_guest_(web_view_guest) { |
34 } | 37 } |
35 | 38 |
36 ChromeWebViewGuestDelegate::~ChromeWebViewGuestDelegate() { | 39 ChromeWebViewGuestDelegate::~ChromeWebViewGuestDelegate() { |
37 } | 40 } |
38 | 41 |
| 42 base::string16 ChromeWebViewGuestDelegate::GetTaskName() const { |
| 43 const int message_id = IDS_TASK_MANAGER_WEBVIEW_TAG_PREFIX; |
| 44 base::string16 title = |
| 45 task_manager::util::GetTitleFromWebContents(guest_web_contents()); |
| 46 return l10n_util::GetStringFUTF16(message_id, title); |
| 47 } |
| 48 |
39 double ChromeWebViewGuestDelegate::GetZoom() { | 49 double ChromeWebViewGuestDelegate::GetZoom() { |
40 return current_zoom_factor_; | 50 return current_zoom_factor_; |
41 } | 51 } |
42 | 52 |
43 bool ChromeWebViewGuestDelegate::HandleContextMenu( | 53 bool ChromeWebViewGuestDelegate::HandleContextMenu( |
44 const content::ContextMenuParams& params) { | 54 const content::ContextMenuParams& params) { |
45 ContextMenuDelegate* menu_delegate = | 55 ContextMenuDelegate* menu_delegate = |
46 ContextMenuDelegate::FromWebContents(guest_web_contents()); | 56 ContextMenuDelegate::FromWebContents(guest_web_contents()); |
47 DCHECK(menu_delegate); | 57 DCHECK(menu_delegate); |
48 | 58 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 accessibility_subscription_.reset(); | 205 accessibility_subscription_.reset(); |
196 } else if (details.notification_type == | 206 } else if (details.notification_type == |
197 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) { | 207 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) { |
198 if (details.enabled) | 208 if (details.enabled) |
199 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost()); | 209 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost()); |
200 else | 210 else |
201 chromevox_injected_ = false; | 211 chromevox_injected_ = false; |
202 } | 212 } |
203 } | 213 } |
204 #endif | 214 #endif |
OLD | NEW |