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/renderer_context_menu/render_view_context_menu.h" | 10 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 pending_menu_ = menu_delegate->BuildMenu(guest_web_contents(), params); | 46 pending_menu_ = menu_delegate->BuildMenu(guest_web_contents(), params); |
47 | 47 |
48 // Pass it to embedder. | 48 // Pass it to embedder. |
49 int request_id = ++pending_context_menu_request_id_; | 49 int request_id = ++pending_context_menu_request_id_; |
50 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 50 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
51 scoped_ptr<base::ListValue> items = | 51 scoped_ptr<base::ListValue> items = |
52 MenuModelToValue(pending_menu_->menu_model()); | 52 MenuModelToValue(pending_menu_->menu_model()); |
53 args->Set(webview::kContextMenuItems, items.release()); | 53 args->Set(webview::kContextMenuItems, items.release()); |
54 args->SetInteger(webview::kRequestId, request_id); | 54 args->SetInteger(webview::kRequestId, request_id); |
55 web_view_guest()->DispatchEventToEmbedder( | 55 web_view_guest()->DispatchEventToView( |
56 new GuestViewBase::Event(webview::kEventContextMenu, args.Pass())); | 56 new GuestViewBase::Event(webview::kEventContextMenu, args.Pass())); |
57 return true; | 57 return true; |
58 } | 58 } |
59 | 59 |
60 // TODO(hanxi) Investigate which of these observers should move to the | 60 // TODO(hanxi) Investigate which of these observers should move to the |
61 // extension module in the future. | 61 // extension module in the future. |
62 void ChromeWebViewGuestDelegate::OnAttachWebViewHelpers( | 62 void ChromeWebViewGuestDelegate::OnAttachWebViewHelpers( |
63 content::WebContents* contents) { | 63 content::WebContents* contents) { |
64 FaviconTabHelper::CreateForWebContents(contents); | 64 FaviconTabHelper::CreateForWebContents(contents); |
65 ChromeExtensionWebContentsObserver::CreateForWebContents(contents); | 65 ChromeExtensionWebContentsObserver::CreateForWebContents(contents); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) { | 166 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) { |
167 if (details.enabled) | 167 if (details.enabled) |
168 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost()); | 168 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost()); |
169 else | 169 else |
170 chromevox_injected_ = false; | 170 chromevox_injected_ = false; |
171 } | 171 } |
172 } | 172 } |
173 #endif | 173 #endif |
174 | 174 |
175 } // namespace extensions | 175 } // namespace extensions |
OLD | NEW |