| 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 #include "chrome/browser/guest_view/app_view/chrome_app_view_guest_delegate.h" | 5 #include "chrome/browser/guest_view/app_view/chrome_app_view_guest_delegate.h" |
| 6 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 6 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
| 7 #include "chrome/browser/task_manager/task_manager_util.h" |
| 8 #include "chrome/grit/generated_resources.h" |
| 7 #include "components/renderer_context_menu/context_menu_delegate.h" | 9 #include "components/renderer_context_menu/context_menu_delegate.h" |
| 10 #include "ui/base/l10n/l10n_util.h" |
| 8 | 11 |
| 9 namespace extensions { | 12 namespace extensions { |
| 10 | 13 |
| 11 ChromeAppViewGuestDelegate::ChromeAppViewGuestDelegate() { | 14 ChromeAppViewGuestDelegate::ChromeAppViewGuestDelegate( |
| 15 extensions::AppViewGuest* app_view_guest) |
| 16 : AppViewGuestDelegate(app_view_guest) { |
| 12 } | 17 } |
| 13 | 18 |
| 14 ChromeAppViewGuestDelegate::~ChromeAppViewGuestDelegate() { | 19 ChromeAppViewGuestDelegate::~ChromeAppViewGuestDelegate() { |
| 15 } | 20 } |
| 16 | 21 |
| 22 base::string16 ChromeAppViewGuestDelegate::GetTaskName() const { |
| 23 const int message_id = IDS_TASK_MANAGER_APPVIEW_TAG_PREFIX; |
| 24 base::string16 title = |
| 25 task_manager::util::GetTitleFromWebContents(guest_web_contents()); |
| 26 return l10n_util::GetStringFUTF16(message_id, title); |
| 27 } |
| 28 |
| 17 bool ChromeAppViewGuestDelegate::HandleContextMenu( | 29 bool ChromeAppViewGuestDelegate::HandleContextMenu( |
| 18 content::WebContents* web_contents, | 30 content::WebContents* web_contents, |
| 19 const content::ContextMenuParams& params) { | 31 const content::ContextMenuParams& params) { |
| 20 ContextMenuDelegate* menu_delegate = | 32 ContextMenuDelegate* menu_delegate = |
| 21 ContextMenuDelegate::FromWebContents(web_contents); | 33 ContextMenuDelegate::FromWebContents(web_contents); |
| 22 DCHECK(menu_delegate); | 34 DCHECK(menu_delegate); |
| 23 | 35 |
| 24 scoped_ptr<RenderViewContextMenu> menu = | 36 scoped_ptr<RenderViewContextMenu> menu = |
| 25 menu_delegate->BuildMenu(web_contents, params); | 37 menu_delegate->BuildMenu(web_contents, params); |
| 26 menu_delegate->ShowMenu(menu.Pass()); | 38 menu_delegate->ShowMenu(menu.Pass()); |
| 27 return true; | 39 return true; |
| 28 } | 40 } |
| 29 | 41 |
| 30 } // namespace extensions | 42 } // namespace extensions |
| OLD | NEW |