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

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

Issue 1658913002: Make extensions use a correct same-origin check. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments. Created 4 years, 10 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
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 <utility> 7 #include <utility>
8 8
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "components/crx_file/id_util.h" 10 #include "components/crx_file/id_util.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 void ExtensionOptionsGuest::DidNavigateMainFrame( 224 void ExtensionOptionsGuest::DidNavigateMainFrame(
225 const content::LoadCommittedDetails& details, 225 const content::LoadCommittedDetails& details,
226 const content::FrameNavigateParams& params) { 226 const content::FrameNavigateParams& params) {
227 if (attached()) { 227 if (attached()) {
228 auto guest_zoom_controller = 228 auto guest_zoom_controller =
229 ui_zoom::ZoomController::FromWebContents(web_contents()); 229 ui_zoom::ZoomController::FromWebContents(web_contents());
230 guest_zoom_controller->SetZoomMode( 230 guest_zoom_controller->SetZoomMode(
231 ui_zoom::ZoomController::ZOOM_MODE_ISOLATED); 231 ui_zoom::ZoomController::ZOOM_MODE_ISOLATED);
232 SetGuestZoomLevelToMatchEmbedder(); 232 SetGuestZoomLevelToMatchEmbedder();
233 233
234 if (params.url.GetOrigin() != options_page_.GetOrigin()) { 234 if (!url::IsSameOriginWith(params.url, options_page_)) {
235 bad_message::ReceivedBadMessage(web_contents()->GetRenderProcessHost(), 235 bad_message::ReceivedBadMessage(web_contents()->GetRenderProcessHost(),
236 bad_message::EOG_BAD_ORIGIN); 236 bad_message::EOG_BAD_ORIGIN);
237 } 237 }
238 } 238 }
239 } 239 }
240 240
241 } // namespace extensions 241 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698