Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: extensions/browser/guest_view/extension_options/extension_options_guest.cc

Issue 1009193003: Make options zoom isolated, match embedder zoom on navigation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve comment. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/ui/zoom/zoom_controller.cc ('k') | extensions/browser/guest_view/guest_view_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/ui/zoom/zoom_controller.cc ('k') | extensions/browser/guest_view/guest_view_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698