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/web_view/web_view_guest.h" | 5 #include "chrome/browser/guest_view/web_view/web_view_guest.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 10 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 base::Unretained(this), | 952 base::Unretained(this), |
953 callback), | 953 callback), |
954 false /* allowed_by_default */); | 954 false /* allowed_by_default */); |
955 } | 955 } |
956 | 956 |
957 content::JavaScriptDialogManager* | 957 content::JavaScriptDialogManager* |
958 WebViewGuest::GetJavaScriptDialogManager() { | 958 WebViewGuest::GetJavaScriptDialogManager() { |
959 return &javascript_dialog_helper_; | 959 return &javascript_dialog_helper_; |
960 } | 960 } |
961 | 961 |
| 962 content::ColorChooser* WebViewGuest::OpenColorChooser( |
| 963 WebContents* web_contents, |
| 964 SkColor color, |
| 965 const std::vector<content::ColorSuggestion>& suggestions) { |
| 966 if (!attached() || !embedder_web_contents()->GetDelegate()) |
| 967 return NULL; |
| 968 return embedder_web_contents()->GetDelegate()->OpenColorChooser( |
| 969 web_contents, color, suggestions); |
| 970 } |
| 971 |
| 972 void WebViewGuest::RunFileChooser(WebContents* web_contents, |
| 973 const content::FileChooserParams& params) { |
| 974 if (!attached() || !embedder_web_contents()->GetDelegate()) |
| 975 return; |
| 976 |
| 977 embedder_web_contents()->GetDelegate()->RunFileChooser(web_contents, params); |
| 978 } |
| 979 |
962 #if defined(OS_CHROMEOS) | 980 #if defined(OS_CHROMEOS) |
963 void WebViewGuest::OnAccessibilityStatusChanged( | 981 void WebViewGuest::OnAccessibilityStatusChanged( |
964 const chromeos::AccessibilityStatusEventDetails& details) { | 982 const chromeos::AccessibilityStatusEventDetails& details) { |
965 if (details.notification_type == chromeos::ACCESSIBILITY_MANAGER_SHUTDOWN) { | 983 if (details.notification_type == chromeos::ACCESSIBILITY_MANAGER_SHUTDOWN) { |
966 accessibility_subscription_.reset(); | 984 accessibility_subscription_.reset(); |
967 } else if (details.notification_type == | 985 } else if (details.notification_type == |
968 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) { | 986 chromeos::ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK) { |
969 if (details.enabled) | 987 if (details.enabled) |
970 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost()); | 988 InjectChromeVoxIfNeeded(guest_web_contents()->GetRenderViewHost()); |
971 else | 989 else |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 if (request_id != pending_context_menu_request_id_) | 1091 if (request_id != pending_context_menu_request_id_) |
1074 return; | 1092 return; |
1075 | 1093 |
1076 // TODO(lazyboy): Implement. | 1094 // TODO(lazyboy): Implement. |
1077 DCHECK(!items); | 1095 DCHECK(!items); |
1078 | 1096 |
1079 ContextMenuDelegate* menu_delegate = | 1097 ContextMenuDelegate* menu_delegate = |
1080 ContextMenuDelegate::FromWebContents(guest_web_contents()); | 1098 ContextMenuDelegate::FromWebContents(guest_web_contents()); |
1081 menu_delegate->ShowMenu(pending_menu_.Pass()); | 1099 menu_delegate->ShowMenu(pending_menu_.Pass()); |
1082 } | 1100 } |
OLD | NEW |