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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 237533008: Refactor GuestView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Introduce template class GuestView. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/guestview/adview/adview_guest.h » ('j') | chrome/browser/guestview/guestview.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 18dd4c317acea99346143bccf39206e1b75a18cc..9699ae8e1595f411d9c2adb24bdb8cb3c509dc46 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -42,7 +42,7 @@
#include "chrome/browser/geolocation/chrome_access_token_store.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/guestview/adview/adview_guest.h"
-#include "chrome/browser/guestview/guestview.h"
+#include "chrome/browser/guestview/guestview_base.h"
#include "chrome/browser/guestview/guestview_constants.h"
#include "chrome/browser/guestview/webview/webview_guest.h"
#include "chrome/browser/media/cast_transport_host_filter.h"
@@ -771,7 +771,7 @@ void ChromeContentBrowserClient::GetStoragePartitionConfigForSite(
partition_name->clear();
*in_memory = false;
- bool success = GuestView::GetGuestPartitionConfigForSite(
+ bool success = GuestViewBase::GetGuestPartitionConfigForSite(
site, partition_domain, partition_name, in_memory);
if (!success && site.SchemeIs(extensions::kExtensionScheme)) {
@@ -837,10 +837,11 @@ void ChromeContentBrowserClient::GuestWebContentsCreated(
return;
}
- /// TODO(fsamuel): In the future, certain types of GuestViews won't require
- // extension bindings. At that point, we should clear |extension_id| instead
- // of exiting early.
- if (!service->GetExtensionById(extension_id, false) &&
+ /// TODO(fsamuel): In the future, certain types of GuestViewBases won't
+ // require extension bindings. At that point, we should clear |extension_id|
+ // instead of exiting early.
+ if (!extension_id.empty() &&
+ !service->GetExtensionById(extension_id, false) &&
!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableBrowserPluginForAllViewTypes)) {
NOTREACHED();
@@ -848,17 +849,15 @@ void ChromeContentBrowserClient::GuestWebContentsCreated(
}
if (opener_web_contents) {
- GuestView* guest = GuestView::FromWebContents(opener_web_contents);
+ GuestViewBase* guest = GuestViewBase::FromWebContents(opener_web_contents);
if (!guest) {
NOTREACHED();
return;
}
- // Create a new GuestView of the same type as the opener.
- *guest_delegate =
- GuestView::Create(guest_web_contents,
- extension_id,
- guest->GetViewType());
+ // Create a new GuestViewBase of the same type as the opener.
+ *guest_delegate = GuestViewBase::Create(
+ guest_web_contents, extension_id, guest->GetViewType());
return;
}
@@ -873,17 +872,14 @@ void ChromeContentBrowserClient::GuestWebContentsCreated(
return;
*guest_delegate =
- GuestView::Create(guest_web_contents,
- extension_id,
- GuestView::GetViewTypeFromString(api_type));
+ GuestViewBase::Create(guest_web_contents, extension_id, api_type);
}
void ChromeContentBrowserClient::GuestWebContentsAttached(
WebContents* guest_web_contents,
WebContents* embedder_web_contents,
const base::DictionaryValue& extra_params) {
-
- GuestView* guest = GuestView::FromWebContents(guest_web_contents);
+ GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents);
if (!guest) {
// It's ok to return here, since we could be running a browser plugin
// outside an extension, and don't need to attach a
@@ -948,7 +944,8 @@ void ChromeContentBrowserClient::RenderProcessWillLaunch(
RendererContentSettingRules rules;
if (host->IsGuest()) {
- GuestView::GetDefaultContentSettingRules(&rules, profile->IsOffTheRecord());
+ GuestViewBase::GetDefaultContentSettingRules(&rules,
+ profile->IsOffTheRecord());
} else {
GetRendererContentSettingRules(
profile->GetHostContentSettingsMap(), &rules);
« no previous file with comments | « no previous file | chrome/browser/guestview/adview/adview_guest.h » ('j') | chrome/browser/guestview/guestview.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698