OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/guest_view/extension_options/chrome_extension_options_g
uest_delegate.h" |
| 6 |
| 7 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
| 8 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
| 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_finder.h" |
| 11 #include "components/renderer_context_menu/context_menu_delegate.h" |
| 12 |
| 13 namespace extensions { |
| 14 |
| 15 ChromeExtensionOptionsGuestDelegate::ChromeExtensionOptionsGuestDelegate() { |
| 16 } |
| 17 |
| 18 ChromeExtensionOptionsGuestDelegate::~ChromeExtensionOptionsGuestDelegate() { |
| 19 } |
| 20 |
| 21 void |
| 22 ChromeExtensionOptionsGuestDelegate::CreateChromeExtensionWebContentsObserver( |
| 23 content::WebContents* web_contents) { |
| 24 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
| 25 web_contents); |
| 26 } |
| 27 |
| 28 bool ChromeExtensionOptionsGuestDelegate::HandleContextMenu( |
| 29 content::WebContents* web_contents, |
| 30 const content::ContextMenuParams& params) { |
| 31 ContextMenuDelegate* menu_delegate = |
| 32 ContextMenuDelegate::FromWebContents(web_contents); |
| 33 DCHECK(menu_delegate); |
| 34 |
| 35 scoped_ptr<RenderViewContextMenu> menu = |
| 36 menu_delegate->BuildMenu(web_contents, params); |
| 37 menu_delegate->ShowMenu(menu.Pass()); |
| 38 return true; |
| 39 } |
| 40 |
| 41 content::WebContents* ChromeExtensionOptionsGuestDelegate::OpenURLInNewTab( |
| 42 content::WebContents* embedder_web_contents, |
| 43 const content::OpenURLParams& params) { |
| 44 Browser* browser = chrome::FindBrowserWithWebContents(embedder_web_contents); |
| 45 return browser->OpenURL(params); |
| 46 } |
| 47 |
| 48 } // namespace extensions |
OLD | NEW |