OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/public/browser/guest_mode.h" |
| 6 |
| 7 #include "base/command_line.h" |
| 8 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 9 #include "content/browser/web_contents/web_contents_impl.h" |
| 10 #include "content/public/browser/web_contents.h" |
| 11 #include "content/public/common/content_switches.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 // static |
| 16 bool GuestMode::IsCrossProcessFrameGuest(WebContents* web_contents) { |
| 17 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 18 switches::kUseCrossProcessFramesForGuests)) |
| 19 return false; |
| 20 BrowserPluginGuest* browser_plugin_guest = |
| 21 static_cast<WebContentsImpl*>(web_contents)->GetBrowserPluginGuest(); |
| 22 return browser_plugin_guest && |
| 23 browser_plugin_guest->can_use_cross_process_frames(); |
| 24 } |
| 25 |
| 26 } // namespace content |
OLD | NEW |