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 "base/values.h" | 7 #include "base/values.h" |
8 #include "components/crx_file/id_util.h" | 8 #include "components/crx_file/id_util.h" |
9 #include "content/public/browser/navigation_details.h" | 9 #include "content/public/browser/navigation_details.h" |
10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 NEW_FOREGROUND_TAB, | 216 NEW_FOREGROUND_TAB, |
217 ui::PAGE_TRANSITION_LINK, | 217 ui::PAGE_TRANSITION_LINK, |
218 false)); | 218 false)); |
219 } | 219 } |
220 return false; | 220 return false; |
221 } | 221 } |
222 | 222 |
223 void ExtensionOptionsGuest::DidNavigateMainFrame( | 223 void ExtensionOptionsGuest::DidNavigateMainFrame( |
224 const content::LoadCommittedDetails& details, | 224 const content::LoadCommittedDetails& details, |
225 const content::FrameNavigateParams& params) { | 225 const content::FrameNavigateParams& params) { |
226 if (attached() && (params.url.GetOrigin() != options_page_.GetOrigin())) { | 226 if (attached()) { |
227 bad_message::ReceivedBadMessage(web_contents()->GetRenderProcessHost(), | 227 auto guest_zoom_controller = |
228 bad_message::EOG_BAD_ORIGIN); | 228 ui_zoom::ZoomController::FromWebContents(web_contents()); |
| 229 guest_zoom_controller->SetZoomMode( |
| 230 ui_zoom::ZoomController::ZOOM_MODE_ISOLATED); |
| 231 SetGuestZoomLevelToMatchEmbedder(); |
| 232 |
| 233 if (params.url.GetOrigin() != options_page_.GetOrigin()) { |
| 234 bad_message::ReceivedBadMessage(web_contents()->GetRenderProcessHost(), |
| 235 bad_message::EOG_BAD_ORIGIN); |
| 236 } |
229 } | 237 } |
230 } | 238 } |
231 | 239 |
232 bool ExtensionOptionsGuest::OnMessageReceived(const IPC::Message& message) { | 240 bool ExtensionOptionsGuest::OnMessageReceived(const IPC::Message& message) { |
233 bool handled = true; | 241 bool handled = true; |
234 IPC_BEGIN_MESSAGE_MAP(ExtensionOptionsGuest, message) | 242 IPC_BEGIN_MESSAGE_MAP(ExtensionOptionsGuest, message) |
235 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) | 243 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) |
236 IPC_MESSAGE_UNHANDLED(handled = false) | 244 IPC_MESSAGE_UNHANDLED(handled = false) |
237 IPC_END_MESSAGE_MAP() | 245 IPC_END_MESSAGE_MAP() |
238 return handled; | 246 return handled; |
239 } | 247 } |
240 | 248 |
241 void ExtensionOptionsGuest::OnRequest( | 249 void ExtensionOptionsGuest::OnRequest( |
242 const ExtensionHostMsg_Request_Params& params) { | 250 const ExtensionHostMsg_Request_Params& params) { |
243 extension_function_dispatcher_->Dispatch(params, | 251 extension_function_dispatcher_->Dispatch(params, |
244 web_contents()->GetRenderViewHost()); | 252 web_contents()->GetRenderViewHost()); |
245 } | 253 } |
246 | 254 |
247 } // namespace extensions | 255 } // namespace extensions |
OLD | NEW |