| 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 "extensions/browser/guest_view/extension_options/extension_options_gues
t.h" | 5 #include "extensions/browser/guest_view/extension_options/extension_options_gues
t.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 bool ExtensionOptionsGuest::HandleContextMenu( | 187 bool ExtensionOptionsGuest::HandleContextMenu( |
| 188 const content::ContextMenuParams& params) { | 188 const content::ContextMenuParams& params) { |
| 189 if (!extension_options_guest_delegate_) | 189 if (!extension_options_guest_delegate_) |
| 190 return false; | 190 return false; |
| 191 | 191 |
| 192 return extension_options_guest_delegate_->HandleContextMenu(params); | 192 return extension_options_guest_delegate_->HandleContextMenu(params); |
| 193 } | 193 } |
| 194 | 194 |
| 195 bool ExtensionOptionsGuest::ShouldCreateWebContents( | 195 bool ExtensionOptionsGuest::ShouldCreateWebContents( |
| 196 WebContents* web_contents, | 196 content::WebContents* web_contents, |
| 197 content::SiteInstance* source_site_instance, |
| 197 int32_t route_id, | 198 int32_t route_id, |
| 198 int32_t main_frame_route_id, | 199 int32_t main_frame_route_id, |
| 199 int32_t main_frame_widget_route_id, | 200 int32_t main_frame_widget_route_id, |
| 200 WindowContainerType window_container_type, | 201 WindowContainerType window_container_type, |
| 202 const GURL& opener_url, |
| 201 const std::string& frame_name, | 203 const std::string& frame_name, |
| 202 const GURL& target_url, | 204 const GURL& target_url, |
| 203 const std::string& partition_id, | 205 const std::string& partition_id, |
| 204 content::SessionStorageNamespace* session_storage_namespace) { | 206 content::SessionStorageNamespace* session_storage_namespace) { |
| 205 // This method handles opening links from within the guest. Since this guest | 207 // This method handles opening links from within the guest. Since this guest |
| 206 // view is used for displaying embedded extension options, we want any | 208 // view is used for displaying embedded extension options, we want any |
| 207 // external links to be opened in a new tab, not in a new guest view. | 209 // external links to be opened in a new tab, not in a new guest view. |
| 208 // Therefore we just open the URL in a new tab, and since we aren't handling | 210 // Therefore we just open the URL in a new tab, and since we aren't handling |
| 209 // the new web contents, we return false. | 211 // the new web contents, we return false. |
| 210 // TODO(ericzeng): Open the tab in the background if the click was a | 212 // TODO(ericzeng): Open the tab in the background if the click was a |
| (...skipping 18 matching lines...) Expand all Loading... |
| 229 SetGuestZoomLevelToMatchEmbedder(); | 231 SetGuestZoomLevelToMatchEmbedder(); |
| 230 | 232 |
| 231 if (!url::IsSameOriginWith(params.url, options_page_)) { | 233 if (!url::IsSameOriginWith(params.url, options_page_)) { |
| 232 bad_message::ReceivedBadMessage(web_contents()->GetRenderProcessHost(), | 234 bad_message::ReceivedBadMessage(web_contents()->GetRenderProcessHost(), |
| 233 bad_message::EOG_BAD_ORIGIN); | 235 bad_message::EOG_BAD_ORIGIN); |
| 234 } | 236 } |
| 235 } | 237 } |
| 236 } | 238 } |
| 237 | 239 |
| 238 } // namespace extensions | 240 } // namespace extensions |
| OLD | NEW |