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

Unified Diff: chrome/browser/guest_view/app_view/app_view_guest.cc

Issue 409603003: Refactor GuestView construction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | « chrome/browser/guest_view/app_view/app_view_guest.h ('k') | chrome/browser/guest_view/guest_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/guest_view/app_view/app_view_guest.cc
diff --git a/chrome/browser/guest_view/app_view/app_view_guest.cc b/chrome/browser/guest_view/app_view/app_view_guest.cc
index 30942a34d1e4691c5d32ed532f159dbc27093bcf..18ebe09ed4e70fe3b114af9e2e6318f1b8033c98 100644
--- a/chrome/browser/guest_view/app_view/app_view_guest.cc
+++ b/chrome/browser/guest_view/app_view/app_view_guest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/guest_view/app_view/app_view_guest.h"
+#include "base/command_line.h"
#include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/guest_view/app_view/app_view_constants.h"
@@ -11,6 +12,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_context_menu/context_menu_delegate.h"
#include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
+#include "chrome/common/chrome_switches.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/common/renderer_preferences.h"
#include "extensions/browser/api/app_runtime/app_runtime_api.h"
@@ -87,6 +89,16 @@ bool AppViewGuest::CompletePendingRequest(
return true;
}
+// static
+GuestViewBase* AppViewGuest::Create(content::BrowserContext* browser_context,
+ int guest_instance_id) {
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableAppView)) {
+ return NULL;
+ }
+ return new AppViewGuest(browser_context, guest_instance_id);
+}
+
AppViewGuest::AppViewGuest(content::BrowserContext* browser_context,
int guest_instance_id)
: GuestView<AppViewGuest>(browser_context, guest_instance_id),
« no previous file with comments | « chrome/browser/guest_view/app_view/app_view_guest.h ('k') | chrome/browser/guest_view/guest_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698