Chromium Code Reviews| Index: chrome/browser/guest_view/app_view/chrome_app_view_guest_delegate.cc |
| diff --git a/chrome/browser/guest_view/app_view/chrome_app_view_guest_delegate.cc b/chrome/browser/guest_view/app_view/chrome_app_view_guest_delegate.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..21046d3678cb4a656d390b004db2ad5b8c9ffe9d |
| --- /dev/null |
| +++ b/chrome/browser/guest_view/app_view/chrome_app_view_guest_delegate.cc |
| @@ -0,0 +1,41 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/extensions/extension_service.h" |
| +#include "chrome/browser/guest_view/app_view/chrome_app_view_guest_delegate.h" |
| +#include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
| +#include "components/renderer_context_menu/context_menu_delegate.h" |
| +#include "extensions/browser/extension_system.h" |
| + |
| +namespace extensions { |
| + |
| +ChromeAppViewGuestDelegate::ChromeAppViewGuestDelegate() { |
| +} |
| + |
| +ChromeAppViewGuestDelegate::~ChromeAppViewGuestDelegate() { |
| +} |
| + |
| +bool ChromeAppViewGuestDelegate::HandleContextMenu( |
|
Xi Han
2014/08/18 21:29:11
Please rename it to OnHandleContextMenu.
|
| + content::WebContents* web_contents, |
| + const content::ContextMenuParams& params) { |
| + ContextMenuDelegate* menu_delegate = |
| + ContextMenuDelegate::FromWebContents(web_contents); |
| + DCHECK(menu_delegate); |
| + |
| + scoped_ptr<RenderViewContextMenu> menu = |
| + menu_delegate->BuildMenu(web_contents, params); |
| + menu_delegate->ShowMenu(menu.Pass()); |
| + return true; |
| +} |
| + |
| +const Extension* ChromeAppViewGuestDelegate::GetExtensionById( |
|
Xi Han
2014/08/18 21:29:11
Please remove this function.
|
| + content::BrowserContext* context, |
| + const std::string& id, |
| + bool include_disabled) const { |
| + ExtensionService* service = |
| + ExtensionSystem::Get(context)->extension_service(); |
| + return service->GetExtensionById(id, include_disabled); |
| +} |
| + |
| +} // namespace extensions |