summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhanxi@chromium.org <hanxi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-26 00:11:21 +0000
committerhanxi@chromium.org <hanxi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-26 00:11:21 +0000
commit38541979ff059ef443c0dc1bc4aab0db146cd060 (patch)
treed810a2028ed9d23604a8ab8cdde27edc3315de52
parente8e5907818051247a08ddf2fca0528035f3e4c50 (diff)
downloadchromium_src-38541979ff059ef443c0dc1bc4aab0db146cd060.zip
chromium_src-38541979ff059ef443c0dc1bc4aab0db146cd060.tar.gz
chromium_src-38541979ff059ef443c0dc1bc4aab0db146cd060.tar.bz2
1. Handle the case of empty embedder_extension_id in guestview.h.
2. Introduce a template class GuestView<T> to handle the *guestview-specific functions in guestview.h: . Rename GuestView to GuestViewBase, introduce GuestView<T> class, and move *ViewGuest-specific functions to GuestView<T>: -- FromWebContents<T>(...) -- From<T>(...). . Introduce a template member function As() in GuestViewBase to replace all of the As*View functions. 3. In each derived *ViewGuest class , e.g., WebViewGuest & AdViewGuest, define a static variable to show its view type (string). BUG=351824 Review URL: https://codereview.chromium.org/237533008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266297 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chrome_content_browser_client.cc39
-rw-r--r--chrome/browser/extensions/api/declarative/declarative_api.cc2
-rw-r--r--chrome/browser/extensions/api/webview/webview_api.h4
-rw-r--r--chrome/browser/extensions/menu_manager.cc2
-rw-r--r--chrome/browser/geolocation/chrome_geolocation_permission_context.cc2
-rw-r--r--chrome/browser/guest_view/OWNERS (renamed from chrome/browser/guestview/OWNERS)0
-rw-r--r--chrome/browser/guest_view/ad_view/ad_view_constants.cc (renamed from chrome/browser/guestview/adview/adview_constants.cc)4
-rw-r--r--chrome/browser/guest_view/ad_view/ad_view_constants.h (renamed from chrome/browser/guestview/adview/adview_constants.h)8
-rw-r--r--chrome/browser/guest_view/ad_view/ad_view_guest.cc (renamed from chrome/browser/guestview/adview/adview_guest.cc)35
-rw-r--r--chrome/browser/guest_view/ad_view/ad_view_guest.h (renamed from chrome/browser/guestview/adview/adview_guest.h)19
-rw-r--r--chrome/browser/guest_view/guest_view.h38
-rw-r--r--chrome/browser/guest_view/guest_view_base.cc (renamed from chrome/browser/guestview/guestview.cc)154
-rw-r--r--chrome/browser/guest_view/guest_view_base.h (renamed from chrome/browser/guestview/guestview.h)79
-rw-r--r--chrome/browser/guest_view/guest_view_constants.cc (renamed from chrome/browser/guestview/guestview_constants.cc)4
-rw-r--r--chrome/browser/guest_view/guest_view_constants.h (renamed from chrome/browser/guestview/guestview_constants.h)8
-rw-r--r--chrome/browser/guest_view/web_view/context_menu_content_type_web_view.cc (renamed from chrome/browser/guestview/webview/context_menu_content_type_webview.cc)2
-rw-r--r--chrome/browser/guest_view/web_view/context_menu_content_type_web_view.h (renamed from chrome/browser/guestview/webview/context_menu_content_type_webview.h)6
-rw-r--r--chrome/browser/guest_view/web_view/javascript_dialog_helper.cc (renamed from chrome/browser/guestview/webview/javascript_dialog_helper.cc)10
-rw-r--r--chrome/browser/guest_view/web_view/javascript_dialog_helper.h (renamed from chrome/browser/guestview/webview/javascript_dialog_helper.h)6
-rw-r--r--chrome/browser/guest_view/web_view/plugin_permission_helper.cc (renamed from chrome/browser/guestview/webview/plugin_permission_helper.cc)8
-rw-r--r--chrome/browser/guest_view/web_view/plugin_permission_helper.h (renamed from chrome/browser/guestview/webview/plugin_permission_helper.h)8
-rw-r--r--chrome/browser/guest_view/web_view/web_view_constants.cc (renamed from chrome/browser/guestview/webview/webview_constants.cc)4
-rw-r--r--chrome/browser/guest_view/web_view/web_view_constants.h (renamed from chrome/browser/guestview/webview/webview_constants.h)8
-rw-r--r--chrome/browser/guest_view/web_view/web_view_find_helper.cc (renamed from chrome/browser/guestview/webview/webview_find_helper.cc)8
-rw-r--r--chrome/browser/guest_view/web_view/web_view_find_helper.h (renamed from chrome/browser/guestview/webview/webview_find_helper.h)6
-rw-r--r--chrome/browser/guest_view/web_view/web_view_guest.cc (renamed from chrome/browser/guestview/webview/webview_guest.cc)93
-rw-r--r--chrome/browser/guest_view/web_view/web_view_guest.h (renamed from chrome/browser/guestview/webview/webview_guest.h)24
-rw-r--r--chrome/browser/guest_view/web_view/web_view_permission_types.h (renamed from chrome/browser/guestview/webview/webview_permission_types.h)8
-rw-r--r--chrome/browser/renderer_context_menu/context_menu_content_type_factory.cc4
-rw-r--r--chrome/browser/renderer_context_menu/render_view_context_menu.cc2
-rw-r--r--chrome/chrome_browser.gypi45
31 files changed, 305 insertions, 335 deletions
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index c0eb710..9c77726 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -41,10 +41,10 @@
#include "chrome/browser/extensions/suggest_permission_util.h"
#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_constants.h"
-#include "chrome/browser/guestview/webview/webview_guest.h"
+#include "chrome/browser/guest_view/ad_view/ad_view_guest.h"
+#include "chrome/browser/guest_view/guest_view_base.h"
+#include "chrome/browser/guest_view/guest_view_constants.h"
+#include "chrome/browser/guest_view/web_view/web_view_guest.h"
#include "chrome/browser/media/cast_transport_host_filter.h"
#include "chrome/browser/media/media_capture_devices_dispatcher.h"
#include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h"
@@ -770,7 +770,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)) {
@@ -836,10 +836,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();
@@ -847,17 +848,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;
}
@@ -872,17 +871,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
@@ -947,7 +943,8 @@ void ChromeContentBrowserClient::RenderProcessWillLaunch(
RendererContentSettingRules rules;
if (host->IsGuest()) {
- GuestView::GetDefaultContentSettingRules(&rules, profile->IsOffTheRecord());
+ GuestViewBase::GetDefaultContentSettingRules(&rules,
+ profile->IsOffTheRecord());
} else {
GetRendererContentSettingRules(
profile->GetHostContentSettingsMap(), &rules);
diff --git a/chrome/browser/extensions/api/declarative/declarative_api.cc b/chrome/browser/extensions/api/declarative/declarative_api.cc
index 3e094ff..7a644c2 100644
--- a/chrome/browser/extensions/api/declarative/declarative_api.cc
+++ b/chrome/browser/extensions/api/declarative/declarative_api.cc
@@ -9,7 +9,7 @@
#include "base/task_runner_util.h"
#include "base/values.h"
#include "chrome/browser/extensions/api/declarative/rules_registry_service.h"
-#include "chrome/browser/guestview/webview/webview_guest.h"
+#include "chrome/browser/guest_view/web_view/web_view_guest.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/events.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/extensions/api/webview/webview_api.h b/chrome/browser/extensions/api/webview/webview_api.h
index b6e011a..b90eef7 100644
--- a/chrome/browser/extensions/api/webview/webview_api.h
+++ b/chrome/browser/extensions/api/webview/webview_api.h
@@ -7,8 +7,8 @@
#include "chrome/browser/extensions/api/capture_web_contents_function.h"
#include "chrome/browser/extensions/api/execute_code_function.h"
-#include "chrome/browser/guestview/webview/webview_find_helper.h"
-#include "chrome/browser/guestview/webview/webview_guest.h"
+#include "chrome/browser/guest_view/web_view/web_view_find_helper.h"
+#include "chrome/browser/guest_view/web_view/web_view_guest.h"
// WARNING: Webview could be loaded in an unblessed context, thus any new
// APIs must extend WebviewExtensionFunction/WebviewExecuteCodeFunction which
diff --git a/chrome/browser/extensions/menu_manager.cc b/chrome/browser/extensions/menu_manager.cc
index 6d32916..dc71cc6 100644
--- a/chrome/browser/extensions/menu_manager.cc
+++ b/chrome/browser/extensions/menu_manager.cc
@@ -18,7 +18,7 @@
#include "chrome/browser/extensions/menu_manager_factory.h"
#include "chrome/browser/extensions/state_store.h"
#include "chrome/browser/extensions/tab_helper.h"
-#include "chrome/browser/guestview/webview/webview_guest.h"
+#include "chrome/browser/guest_view/web_view/web_view_guest.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/context_menus.h"
#include "chrome/common/extensions/api/webview.h"
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
index 7364754..f5507c7 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
@@ -15,7 +15,7 @@
#include "chrome/browser/content_settings/permission_request_id.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/extensions/suggest_permission_util.h"
-#include "chrome/browser/guestview/webview/webview_guest.h"
+#include "chrome/browser/guest_view/web_view/web_view_guest.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
diff --git a/chrome/browser/guestview/OWNERS b/chrome/browser/guest_view/OWNERS
index c92691f..c92691f 100644
--- a/chrome/browser/guestview/OWNERS
+++ b/chrome/browser/guest_view/OWNERS
diff --git a/chrome/browser/guestview/adview/adview_constants.cc b/chrome/browser/guest_view/ad_view/ad_view_constants.cc
index 8ba709c..d083d7e 100644
--- a/chrome/browser/guestview/adview/adview_constants.cc
+++ b/chrome/browser/guest_view/ad_view/ad_view_constants.cc
@@ -1,8 +1,8 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/guestview/adview/adview_constants.h"
+#include "chrome/browser/guest_view/ad_view/ad_view_constants.h"
namespace adview {
diff --git a/chrome/browser/guestview/adview/adview_constants.h b/chrome/browser/guest_view/ad_view/ad_view_constants.h
index 5bb5490..c7206ff 100644
--- a/chrome/browser/guestview/adview/adview_constants.h
+++ b/chrome/browser/guest_view/ad_view/ad_view_constants.h
@@ -1,11 +1,11 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Constants used for the adview API.
-#ifndef CHROME_BROWSER_GUESTVIEW_ADVIEW_ADVIEW_CONSTANTS_H_
-#define CHROME_BROWSER_GUESTVIEW_ADVIEW_ADVIEW_CONSTANTS_H_
+#ifndef CHROME_BROWSER_GUEST_VIEW_AD_VIEW_AD_VIEW_CONSTANTS_H_
+#define CHROME_BROWSER_GUEST_VIEW_AD_VIEW_AD_VIEW_CONSTANTS_H_
namespace adview {
@@ -15,5 +15,5 @@ extern const char kEventLoadCommit[];
} // namespace adview
-#endif // CHROME_BROWSER_GUESTVIEW_ADVIEW_ADVIEW_CONSTANTS_H_
+#endif // CHROME_BROWSER_GUEST_VIEW_AD_VIEW_AD_VIEW_CONSTANTS_H_
diff --git a/chrome/browser/guestview/adview/adview_guest.cc b/chrome/browser/guest_view/ad_view/ad_view_guest.cc
index 6b0de6f..c43718a 100644
--- a/chrome/browser/guestview/adview/adview_guest.cc
+++ b/chrome/browser/guest_view/ad_view/ad_view_guest.cc
@@ -1,12 +1,12 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/guestview/adview/adview_guest.h"
+#include "chrome/browser/guest_view/ad_view/ad_view_guest.h"
#include "base/strings/string_util.h"
-#include "chrome/browser/guestview/adview/adview_constants.h"
-#include "chrome/browser/guestview/guestview_constants.h"
+#include "chrome/browser/guest_view/ad_view/ad_view_constants.h"
+#include "chrome/browser/guest_view/guest_view_constants.h"
#include "content/public/browser/web_contents.h"
#include "net/base/net_errors.h"
@@ -14,30 +14,12 @@ using content::WebContents;
AdViewGuest::AdViewGuest(WebContents* guest_web_contents,
const std::string& extension_id)
- : GuestView(guest_web_contents, extension_id),
+ : GuestView<AdViewGuest>(guest_web_contents, extension_id),
WebContentsObserver(guest_web_contents) {
}
// static
-AdViewGuest* AdViewGuest::From(int embedder_process_id,
- int guest_instance_id) {
- GuestView* guest = GuestView::From(embedder_process_id, guest_instance_id);
- if (!guest)
- return NULL;
- return guest->AsAdView();
-}
-
-GuestView::Type AdViewGuest::GetViewType() const {
- return GuestView::ADVIEW;
-}
-
-WebViewGuest* AdViewGuest::AsWebView() {
- return NULL;
-}
-
-AdViewGuest* AdViewGuest::AsAdView() {
- return this;
-}
+const std::string& AdViewGuest::Type = "adview";
AdViewGuest::~AdViewGuest() {
}
@@ -52,7 +34,8 @@ void AdViewGuest::DidCommitProvisionalLoadForFrame(
scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
args->SetString(guestview::kUrl, url.spec());
args->SetBoolean(guestview::kIsTopLevel, is_main_frame);
- DispatchEvent(new GuestView::Event(adview::kEventLoadCommit, args.Pass()));
+ DispatchEvent(
+ new GuestViewBase::Event(adview::kEventLoadCommit, args.Pass()));
}
void AdViewGuest::DidFailProvisionalLoad(
@@ -71,5 +54,5 @@ void AdViewGuest::DidFailProvisionalLoad(
args->SetBoolean(guestview::kIsTopLevel, is_main_frame);
args->SetString(guestview::kUrl, validated_url.spec());
args->SetString(guestview::kReason, error_type);
- DispatchEvent(new GuestView::Event(adview::kEventLoadAbort, args.Pass()));
+ DispatchEvent(new GuestViewBase::Event(adview::kEventLoadAbort, args.Pass()));
}
diff --git a/chrome/browser/guestview/adview/adview_guest.h b/chrome/browser/guest_view/ad_view/ad_view_guest.h
index aaefe00..2374558 100644
--- a/chrome/browser/guestview/adview/adview_guest.h
+++ b/chrome/browser/guest_view/ad_view/ad_view_guest.h
@@ -1,12 +1,12 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_GUESTVIEW_ADVIEW_ADVIEW_GUEST_H_
-#define CHROME_BROWSER_GUESTVIEW_ADVIEW_ADVIEW_GUEST_H_
+#ifndef CHROME_BROWSER_GUEST_VIEW_AD_VIEW_AD_VIEW_GUEST_H_
+#define CHROME_BROWSER_GUEST_VIEW_AD_VIEW_AD_VIEW_GUEST_H_
#include "base/values.h"
-#include "chrome/browser/guestview/guestview.h"
+#include "chrome/browser/guest_view/guest_view.h"
#include "content/public/browser/web_contents_observer.h"
// An AdViewGuest is a WebContentsObserver on the guest WebContents of a
@@ -16,18 +16,13 @@
// a particular embedder WebContents, we call this "attachment".
// TODO(fsamuel): There might be an opportunity here to refactor and reuse code
// between AdViewGuest and WebViewGuest.
-class AdViewGuest : public GuestView,
+class AdViewGuest : public GuestView<AdViewGuest>,
public content::WebContentsObserver {
public:
AdViewGuest(content::WebContents* guest_web_contents,
const std::string& extension_id);
- static AdViewGuest* From(int embedder_process_id, int instance_id);
-
- // GuestView implementation.
- virtual GuestView::Type GetViewType() const OVERRIDE;
- virtual WebViewGuest* AsWebView() OVERRIDE;
- virtual AdViewGuest* AsAdView() OVERRIDE;
+ static const std::string& Type;
private:
virtual ~AdViewGuest();
@@ -51,4 +46,4 @@ class AdViewGuest : public GuestView,
DISALLOW_COPY_AND_ASSIGN(AdViewGuest);
};
-#endif // CHROME_BROWSER_GUESTVIEW_ADVIEW_ADVIEW_GUEST_H_
+#endif // CHROME_BROWSER_GUEST_VIEW_AD_VIEW_AD_VIEW_GUEST_H_
diff --git a/chrome/browser/guest_view/guest_view.h b/chrome/browser/guest_view/guest_view.h
new file mode 100644
index 0000000..9cc0954
--- /dev/null
+++ b/chrome/browser/guest_view/guest_view.h
@@ -0,0 +1,38 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_
+#define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_
+
+#include "chrome/browser/guest_view/guest_view_base.h"
+
+template <typename T>
+class GuestView : public GuestViewBase {
+ public:
+ static T* From(int embedder_process_id, int guest_instance_id) {
+ GuestViewBase* guest =
+ GuestViewBase::From(embedder_process_id, guest_instance_id);
+ if (!guest)
+ return NULL;
+ return guest->As<T>();
+ }
+
+ static T* FromWebContents(content::WebContents* contents) {
+ GuestViewBase* guest = GuestViewBase::FromWebContents(contents);
+ return guest ? guest->As<T>() : NULL;
+ }
+
+ // GuestViewBase implementation.
+ virtual const std::string& GetViewType() const OVERRIDE { return T::Type; }
+
+ protected:
+ GuestView(content::WebContents* guest_web_contents,
+ const std::string& embedder_extension_id)
+ : GuestViewBase(guest_web_contents, embedder_extension_id) {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GuestView);
+};
+
+#endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_H_
diff --git a/chrome/browser/guestview/guestview.cc b/chrome/browser/guest_view/guest_view_base.cc
index 7cd6c59b..a6ea195 100644
--- a/chrome/browser/guestview/guestview.cc
+++ b/chrome/browser/guest_view/guest_view_base.cc
@@ -1,13 +1,13 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/guestview/guestview.h"
+#include "chrome/browser/guest_view/guest_view_base.h"
#include "base/lazy_instance.h"
-#include "chrome/browser/guestview/adview/adview_guest.h"
-#include "chrome/browser/guestview/guestview_constants.h"
-#include "chrome/browser/guestview/webview/webview_guest.h"
+#include "chrome/browser/guest_view/ad_view/ad_view_guest.h"
+#include "chrome/browser/guest_view/guest_view_constants.h"
+#include "chrome/browser/guest_view/web_view/web_view_guest.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/content_settings.h"
#include "content/public/browser/render_process_host.h"
@@ -20,32 +20,31 @@ using content::WebContents;
namespace {
-// <embedder_process_id, guest_instance_id> => GuestView*
-typedef std::map<std::pair<int, int>, GuestView*> EmbedderGuestViewMap;
+// <embedder_process_id, guest_instance_id> => GuestViewBase*
+typedef std::map<std::pair<int, int>, GuestViewBase*> EmbedderGuestViewMap;
static base::LazyInstance<EmbedderGuestViewMap> embedder_guestview_map =
LAZY_INSTANCE_INITIALIZER;
-typedef std::map<WebContents*, GuestView*> WebContentsGuestViewMap;
+typedef std::map<WebContents*, GuestViewBase*> WebContentsGuestViewMap;
static base::LazyInstance<WebContentsGuestViewMap> webcontents_guestview_map =
LAZY_INSTANCE_INITIALIZER;
} // namespace
-GuestView::Event::Event(const std::string& name,
- scoped_ptr<base::DictionaryValue> args)
- : name_(name),
- args_(args.Pass()) {
+GuestViewBase::Event::Event(const std::string& name,
+ scoped_ptr<base::DictionaryValue> args)
+ : name_(name), args_(args.Pass()) {
}
-GuestView::Event::~Event() {
+GuestViewBase::Event::~Event() {
}
-scoped_ptr<base::DictionaryValue> GuestView::Event::GetArguments() {
+scoped_ptr<base::DictionaryValue> GuestViewBase::Event::GetArguments() {
return args_.Pass();
}
-GuestView::GuestView(WebContents* guest_web_contents,
- const std::string& embedder_extension_id)
+GuestViewBase::GuestViewBase(WebContents* guest_web_contents,
+ const std::string& embedder_extension_id)
: guest_web_contents_(guest_web_contents),
embedder_web_contents_(NULL),
embedder_extension_id_(embedder_extension_id),
@@ -59,50 +58,40 @@ GuestView::GuestView(WebContents* guest_web_contents,
}
// static
-GuestView::Type GuestView::GetViewTypeFromString(const std::string& api_type) {
- if (api_type == "adview") {
- return GuestView::ADVIEW;
- } else if (api_type == "webview") {
- return GuestView::WEBVIEW;
- }
- return GuestView::UNKNOWN;
-}
-
-// static
-GuestView* GuestView::Create(WebContents* guest_web_contents,
- const std::string& embedder_extension_id,
- GuestView::Type view_type) {
- switch (view_type) {
- case GuestView::WEBVIEW:
- return new WebViewGuest(guest_web_contents, embedder_extension_id);
- case GuestView::ADVIEW:
- return new AdViewGuest(guest_web_contents, embedder_extension_id);
- default:
- NOTREACHED();
- return NULL;
+GuestViewBase* GuestViewBase::Create(WebContents* guest_web_contents,
+ const std::string& embedder_extension_id,
+ const std::string& view_type) {
+ if (view_type == "webview") {
+ return new WebViewGuest(guest_web_contents, embedder_extension_id);
+ } else if (view_type == "adview") {
+ return new AdViewGuest(guest_web_contents, embedder_extension_id);
}
+ NOTREACHED();
+ return NULL;
}
// static
-GuestView* GuestView::FromWebContents(WebContents* web_contents) {
+GuestViewBase* GuestViewBase::FromWebContents(WebContents* web_contents) {
WebContentsGuestViewMap* guest_map = webcontents_guestview_map.Pointer();
WebContentsGuestViewMap::iterator it = guest_map->find(web_contents);
return it == guest_map->end() ? NULL : it->second;
}
// static
-GuestView* GuestView::From(int embedder_process_id, int guest_instance_id) {
+GuestViewBase* GuestViewBase::From(int embedder_process_id,
+ int guest_instance_id) {
EmbedderGuestViewMap* guest_map = embedder_guestview_map.Pointer();
- EmbedderGuestViewMap::iterator it = guest_map->find(
- std::make_pair(embedder_process_id, guest_instance_id));
+ EmbedderGuestViewMap::iterator it =
+ guest_map->find(std::make_pair(embedder_process_id, guest_instance_id));
return it == guest_map->end() ? NULL : it->second;
}
// static
-bool GuestView::GetGuestPartitionConfigForSite(const GURL& site,
- std::string* partition_domain,
- std::string* partition_name,
- bool* in_memory) {
+bool GuestViewBase::GetGuestPartitionConfigForSite(
+ const GURL& site,
+ std::string* partition_domain,
+ std::string* partition_name,
+ bool* in_memory) {
if (!site.SchemeIs(content::kGuestScheme))
return false;
@@ -115,31 +104,32 @@ bool GuestView::GetGuestPartitionConfigForSite(const GURL& site,
*in_memory = (site.path() != "/persist");
// The partition name is user supplied value, which we have encoded when the
// URL was created, so it needs to be decoded.
- *partition_name = net::UnescapeURLComponent(site.query(),
- net::UnescapeRule::NORMAL);
+ *partition_name =
+ net::UnescapeURLComponent(site.query(), net::UnescapeRule::NORMAL);
return true;
}
// static
-void GuestView::GetDefaultContentSettingRules(
- RendererContentSettingRules* rules, bool incognito) {
- rules->image_rules.push_back(ContentSettingPatternSource(
- ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTING_ALLOW,
- std::string(),
- incognito));
-
- rules->script_rules.push_back(ContentSettingPatternSource(
- ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTING_ALLOW,
- std::string(),
- incognito));
-}
-
-void GuestView::Attach(content::WebContents* embedder_web_contents,
- const base::DictionaryValue& args) {
+void GuestViewBase::GetDefaultContentSettingRules(
+ RendererContentSettingRules* rules,
+ bool incognito) {
+ rules->image_rules.push_back(
+ ContentSettingPatternSource(ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTING_ALLOW,
+ std::string(),
+ incognito));
+
+ rules->script_rules.push_back(
+ ContentSettingPatternSource(ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTING_ALLOW,
+ std::string(),
+ incognito));
+}
+
+void GuestViewBase::Attach(content::WebContents* embedder_web_contents,
+ const base::DictionaryValue& args) {
embedder_web_contents_ = embedder_web_contents;
embedder_render_process_id_ =
embedder_web_contents->GetRenderProcessHost()->GetID();
@@ -148,7 +138,7 @@ void GuestView::Attach(content::WebContents* embedder_web_contents,
std::pair<int, int> key(embedder_render_process_id_, guest_instance_id_);
embedder_guestview_map.Get().insert(std::make_pair(key, this));
- // GuestView::Attach is called prior to initialization (and initial
+ // GuestViewBase::Attach is called prior to initialization (and initial
// navigation) of the guest in the content layer in order to permit mapping
// the necessary associations between the <*view> element and its guest. This
// is needed by the <webview> WebRequest API to allow intercepting resource
@@ -160,23 +150,11 @@ void GuestView::Attach(content::WebContents* embedder_web_contents,
base::MessageLoop::current()->PostTask(
FROM_HERE,
- base::Bind(&GuestView::SendQueuedEvents,
+ base::Bind(&GuestViewBase::SendQueuedEvents,
weak_ptr_factory_.GetWeakPtr()));
}
-GuestView::Type GuestView::GetViewType() const {
- return GuestView::UNKNOWN;
-}
-
-WebViewGuest* GuestView::AsWebView() {
- return NULL;
-}
-
-AdViewGuest* GuestView::AsAdView() {
- return NULL;
-}
-
-GuestView::~GuestView() {
+GuestViewBase::~GuestViewBase() {
std::pair<int, int> key(embedder_render_process_id_, guest_instance_id_);
embedder_guestview_map.Get().erase(key);
@@ -185,7 +163,7 @@ GuestView::~GuestView() {
pending_events_.clear();
}
-void GuestView::DispatchEvent(Event* event) {
+void GuestViewBase::DispatchEvent(Event* event) {
scoped_ptr<Event> event_ptr(event);
if (!in_extension()) {
NOTREACHED();
@@ -206,12 +184,16 @@ void GuestView::DispatchEvent(Event* event) {
args->Append(event->GetArguments().release());
extensions::EventRouter::DispatchEvent(
- embedder_web_contents_, profile, embedder_extension_id_,
- event->name(), args.Pass(),
- extensions::EventRouter::USER_GESTURE_UNKNOWN, info);
+ embedder_web_contents_,
+ profile,
+ embedder_extension_id_,
+ event->name(),
+ args.Pass(),
+ extensions::EventRouter::USER_GESTURE_UNKNOWN,
+ info);
}
-void GuestView::SendQueuedEvents() {
+void GuestViewBase::SendQueuedEvents() {
if (!attached())
return;
diff --git a/chrome/browser/guestview/guestview.h b/chrome/browser/guest_view/guest_view_base.h
index 3ff23f4..4422297 100644
--- a/chrome/browser/guestview/guestview.h
+++ b/chrome/browser/guest_view/guest_view_base.h
@@ -1,9 +1,9 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_
-#define CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_
+#ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_
+#define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_
#include <queue>
@@ -16,22 +16,16 @@ class AdViewGuest;
class WebViewGuest;
struct RendererContentSettingRules;
-// A GuestView is the base class browser-side API implementation for a <*view>
-// tag. GuestView maintains an association between a guest WebContents and an
-// embedder WebContents. It receives events issued from the guest and relays
-// them to the embedder.
-class GuestView : public content::BrowserPluginGuestDelegate {
+// A GuestViewBase is the base class browser-side API implementation for a
+// <*view> tag. GuestViewBase maintains an association between a guest
+// WebContents and an embedder WebContents. It receives events issued from
+// the guest and relays them to the embedder.
+class GuestViewBase : public content::BrowserPluginGuestDelegate {
public:
- enum Type {
- WEBVIEW,
- ADVIEW,
- UNKNOWN
- };
-
class Event {
public:
- Event(const std::string& name, scoped_ptr<base::DictionaryValue> args);
- ~Event();
+ Event(const std::string& name, scoped_ptr<base::DictionaryValue> args);
+ ~Event();
const std::string& name() const { return name_; }
@@ -42,19 +36,26 @@ class GuestView : public content::BrowserPluginGuestDelegate {
scoped_ptr<base::DictionaryValue> args_;
};
- static Type GetViewTypeFromString(const std::string& api_type);
+ // Returns a *ViewGuest if this GuestView is of the given view type.
+ template <typename T>
+ T* As() {
+ if (GetViewType() == T::Type) {
+ return static_cast<T*>(this);
+ }
+ return NULL;
+ }
- static GuestView* Create(content::WebContents* guest_web_contents,
- const std::string& embedder_extension_id,
- Type view_type);
+ static GuestViewBase* Create(content::WebContents* guest_web_contents,
+ const std::string& embedder_extension_id,
+ const std::string& view_type);
- static GuestView* FromWebContents(content::WebContents* web_contents);
+ static GuestViewBase* FromWebContents(content::WebContents* web_contents);
- static GuestView* From(int embedder_process_id, int instance_id);
+ static GuestViewBase* From(int embedder_process_id, int instance_id);
- // For GuestViews, we create special guest processes, which host the
+ // For GuestViewBases, we create special guest processes, which host the
// tag content separately from the main application that embeds the tag.
- // A GuestView can specify both the partition name and whether the storage
+ // A GuestViewBase can specify both the partition name and whether the storage
// for that partition should be persisted. Each tag gets a SiteInstance with
// a specially formatted URL, based on the application it is hosted by and
// the partition requested by it. The format for that URL is:
@@ -65,8 +66,10 @@ class GuestView : public content::BrowserPluginGuestDelegate {
bool* in_memory);
// By default, JavaScript and images are enabled in guest content.
- static void GetDefaultContentSettingRules(
- RendererContentSettingRules* rules, bool incognito);
+ static void GetDefaultContentSettingRules(RendererContentSettingRules* rules,
+ bool incognito);
+
+ virtual const std::string& GetViewType() const = 0;
virtual void Attach(content::WebContents* embedder_web_contents,
const base::DictionaryValue& args);
@@ -80,14 +83,6 @@ class GuestView : public content::BrowserPluginGuestDelegate {
return guest_web_contents_;
}
- virtual Type GetViewType() const;
-
- // Returns a WebViewGuest if this GuestView belongs to a <webview>.
- virtual WebViewGuest* AsWebView() = 0;
-
- // Returns an AdViewGuest if the GuestView belongs to an <adview>.
- virtual AdViewGuest* AsAdView() = 0;
-
// Returns whether this guest has an associated embedder.
bool attached() const { return !!embedder_web_contents_; }
@@ -103,9 +98,7 @@ class GuestView : public content::BrowserPluginGuestDelegate {
}
// Returns whether this GuestView is embedded in an extension/app.
- bool in_extension() const {
- return !embedder_extension_id_.empty();
- }
+ bool in_extension() const { return !embedder_extension_id_.empty(); }
// Returns the user browser context of the embedder.
content::BrowserContext* browser_context() const { return browser_context_; }
@@ -114,9 +107,9 @@ class GuestView : public content::BrowserPluginGuestDelegate {
int embedder_render_process_id() const { return embedder_render_process_id_; }
protected:
- GuestView(content::WebContents* guest_web_contents,
- const std::string& embedder_extension_id);
- virtual ~GuestView();
+ GuestViewBase(content::WebContents* guest_web_contents,
+ const std::string& embedder_extension_id);
+ virtual ~GuestViewBase();
// Dispatches an event |event_name| to the embedder with the |event| fields.
void DispatchEvent(Event* event);
@@ -142,9 +135,9 @@ class GuestView : public content::BrowserPluginGuestDelegate {
// This is used to ensure pending tasks will not fire after this object is
// destroyed.
- base::WeakPtrFactory<GuestView> weak_ptr_factory_;
+ base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_;
- DISALLOW_COPY_AND_ASSIGN(GuestView);
+ DISALLOW_COPY_AND_ASSIGN(GuestViewBase);
};
-#endif // CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_
+#endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_
diff --git a/chrome/browser/guestview/guestview_constants.cc b/chrome/browser/guest_view/guest_view_constants.cc
index d1d9e82..844c3e13 100644
--- a/chrome/browser/guestview/guestview_constants.cc
+++ b/chrome/browser/guest_view/guest_view_constants.cc
@@ -1,8 +1,8 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/guestview/guestview_constants.h"
+#include "chrome/browser/guest_view/guest_view_constants.h"
namespace guestview {
diff --git a/chrome/browser/guestview/guestview_constants.h b/chrome/browser/guest_view/guest_view_constants.h
index 7f1e03e..dbdfb62 100644
--- a/chrome/browser/guestview/guestview_constants.h
+++ b/chrome/browser/guest_view/guest_view_constants.h
@@ -1,11 +1,11 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Constants used for the WebView API.
-#ifndef CHROME_BROWSER_GUESTVIEW_GUESTVIEW_CONSTANTS_H_
-#define CHROME_BROWSER_GUESTVIEW_GUESTVIEW_CONSTANTS_H_
+#ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_CONSTANTS_H_
+#define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_CONSTANTS_H_
namespace guestview {
@@ -24,5 +24,5 @@ extern const int kInstanceIDNone;
} // namespace guestview
-#endif // CHROME_BROWSER_GUESTVIEW_GUESTVIEW_CONSTANTS_H_
+#endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_CONSTANTS_H_
diff --git a/chrome/browser/guestview/webview/context_menu_content_type_webview.cc b/chrome/browser/guest_view/web_view/context_menu_content_type_web_view.cc
index 4db0e80..fa21e10 100644
--- a/chrome/browser/guestview/webview/context_menu_content_type_webview.cc
+++ b/chrome/browser/guest_view/web_view/context_menu_content_type_web_view.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/guestview/webview/context_menu_content_type_webview.h"
+#include "chrome/browser/guest_view/web_view/context_menu_content_type_web_view.h"
ContextMenuContentTypeWebView::ContextMenuContentTypeWebView(
content::WebContents* web_contents,
diff --git a/chrome/browser/guestview/webview/context_menu_content_type_webview.h b/chrome/browser/guest_view/web_view/context_menu_content_type_web_view.h
index 9c87334..8bd2388 100644
--- a/chrome/browser/guestview/webview/context_menu_content_type_webview.h
+++ b/chrome/browser/guest_view/web_view/context_menu_content_type_web_view.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_GUESTVIEW_WEBVIEW_CONTEXT_MENU_CONTENT_TYPE_WEBVIEW_H_
-#define CHROME_BROWSER_GUESTVIEW_WEBVIEW_CONTEXT_MENU_CONTENT_TYPE_WEBVIEW_H_
+#ifndef CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CONTEXT_MENU_CONTENT_TYPE_WEB_VIEW_H_
+#define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CONTEXT_MENU_CONTENT_TYPE_WEB_VIEW_H_
#include "chrome/browser/renderer_context_menu/context_menu_content_type.h"
@@ -28,4 +28,4 @@ class ContextMenuContentTypeWebView : public ContextMenuContentType {
DISALLOW_COPY_AND_ASSIGN(ContextMenuContentTypeWebView);
};
-#endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_CONTEXT_MENU_CONTENT_TYPE_WEBVIEW_H_
+#endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_CONTEXT_MENU_CONTENT_TYPE_WEB_VIEW_H_
diff --git a/chrome/browser/guestview/webview/javascript_dialog_helper.cc b/chrome/browser/guest_view/web_view/javascript_dialog_helper.cc
index 8173f06..2c198e5 100644
--- a/chrome/browser/guestview/webview/javascript_dialog_helper.cc
+++ b/chrome/browser/guest_view/web_view/javascript_dialog_helper.cc
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/guestview/webview/javascript_dialog_helper.h"
+#include "chrome/browser/guest_view/web_view/javascript_dialog_helper.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
-#include "chrome/browser/guestview/guestview_constants.h"
-#include "chrome/browser/guestview/webview/webview_constants.h"
-#include "chrome/browser/guestview/webview/webview_guest.h"
-#include "chrome/browser/guestview/webview/webview_permission_types.h"
+#include "chrome/browser/guest_view/guest_view_constants.h"
+#include "chrome/browser/guest_view/web_view/web_view_constants.h"
+#include "chrome/browser/guest_view/web_view/web_view_guest.h"
+#include "chrome/browser/guest_view/web_view/web_view_permission_types.h"
namespace {
diff --git a/chrome/browser/guestview/webview/javascript_dialog_helper.h b/chrome/browser/guest_view/web_view/javascript_dialog_helper.h
index 4f536bd..94f7374 100644
--- a/chrome/browser/guestview/webview/javascript_dialog_helper.h
+++ b/chrome/browser/guest_view/web_view/javascript_dialog_helper.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_GUESTVIEW_WEBVIEW_JAVASCRIPT_DIALOG_HELPER_H_
-#define CHROME_BROWSER_GUESTVIEW_WEBVIEW_JAVASCRIPT_DIALOG_HELPER_H_
+#ifndef CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_JAVASCRIPT_DIALOG_HELPER_H_
+#define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_JAVASCRIPT_DIALOG_HELPER_H_
#include "content/public/browser/javascript_dialog_manager.h"
@@ -50,4 +50,4 @@ class JavaScriptDialogHelper : public content::JavaScriptDialogManager {
DISALLOW_COPY_AND_ASSIGN(JavaScriptDialogHelper);
};
-#endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_JAVASCRIPT_DIALOG_HELPER_H_
+#endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_JAVASCRIPT_DIALOG_HELPER_H_
diff --git a/chrome/browser/guestview/webview/plugin_permission_helper.cc b/chrome/browser/guest_view/web_view/plugin_permission_helper.cc
index a4fd5d4..12bcc7d 100644
--- a/chrome/browser/guestview/webview/plugin_permission_helper.cc
+++ b/chrome/browser/guest_view/web_view/plugin_permission_helper.cc
@@ -1,11 +1,11 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/guestview/webview/plugin_permission_helper.h"
+#include "chrome/browser/guest_view/web_view/plugin_permission_helper.h"
-#include "chrome/browser/guestview/webview/webview_guest.h"
-#include "chrome/browser/guestview/webview/webview_permission_types.h"
+#include "chrome/browser/guest_view/web_view/web_view_guest.h"
+#include "chrome/browser/guest_view/web_view/web_view_permission_types.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#include "chrome/common/render_messages.h"
#include "content/public/browser/render_process_host.h"
diff --git a/chrome/browser/guestview/webview/plugin_permission_helper.h b/chrome/browser/guest_view/web_view/plugin_permission_helper.h
index 0c280e9..e937bc3 100644
--- a/chrome/browser/guestview/webview/plugin_permission_helper.h
+++ b/chrome/browser/guest_view/web_view/plugin_permission_helper.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_GUESTVIEW_WEBVIEW_PLUGIN_PERMISSION_HELPER_H_
-#define CHROME_BROWSER_GUESTVIEW_WEBVIEW_PLUGIN_PERMISSION_HELPER_H_
+#ifndef CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_PLUGIN_PERMISSION_HELPER_H_
+#define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_PLUGIN_PERMISSION_HELPER_H_
#include "base/memory/weak_ptr.h"
#include "content/public/browser/web_contents_observer.h"
@@ -45,4 +45,4 @@ class PluginPermissionHelper
DISALLOW_COPY_AND_ASSIGN(PluginPermissionHelper);
};
-#endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_PLUGIN_PERMISSION_HELPER_H_
+#endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_PLUGIN_PERMISSION_HELPER_H_
diff --git a/chrome/browser/guestview/webview/webview_constants.cc b/chrome/browser/guest_view/web_view/web_view_constants.cc
index 2bd5e69..408d1ee 100644
--- a/chrome/browser/guestview/webview/webview_constants.cc
+++ b/chrome/browser/guest_view/web_view/web_view_constants.cc
@@ -1,8 +1,8 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/guestview/webview/webview_constants.h"
+#include "chrome/browser/guest_view/web_view/web_view_constants.h"
namespace webview {
diff --git a/chrome/browser/guestview/webview/webview_constants.h b/chrome/browser/guest_view/web_view/web_view_constants.h
index a05c9b903..ff50895 100644
--- a/chrome/browser/guestview/webview/webview_constants.h
+++ b/chrome/browser/guest_view/web_view/web_view_constants.h
@@ -1,11 +1,11 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Constants used for the WebView API.
-#ifndef CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_CONSTANTS_H_
-#define CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_CONSTANTS_H_
+#ifndef CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_CONSTANTS_H_
+#define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_CONSTANTS_H_
namespace webview {
@@ -86,4 +86,4 @@ extern const int kInvalidPermissionRequestID;
} // namespace webview
-#endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_CONSTANTS_H_
+#endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_CONSTANTS_H_
diff --git a/chrome/browser/guestview/webview/webview_find_helper.cc b/chrome/browser/guest_view/web_view/web_view_find_helper.cc
index d636a78..e292a50 100644
--- a/chrome/browser/guestview/webview/webview_find_helper.cc
+++ b/chrome/browser/guest_view/web_view/web_view_find_helper.cc
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/guestview/webview/webview_find_helper.h"
+#include "chrome/browser/guest_view/web_view/web_view_find_helper.h"
#include <utility>
#include "chrome/browser/extensions/api/webview/webview_api.h"
-#include "chrome/browser/guestview/webview/webview_constants.h"
+#include "chrome/browser/guest_view/web_view/web_view_constants.h"
WebviewFindHelper::WebviewFindHelper(WebViewGuest* webview_guest)
: webview_guest_(webview_guest),
@@ -36,8 +36,8 @@ void WebviewFindHelper::DispatchFindUpdateEvent(bool canceled,
args->SetBoolean(webview::kFindCanceled, canceled);
args->SetBoolean(webview::kFindFinalUpdate, final_update);
DCHECK(webview_guest_);
- webview_guest_->DispatchEvent(new GuestView::Event(webview::kEventFindReply,
- args.Pass()));
+ webview_guest_->DispatchEvent(
+ new GuestViewBase::Event(webview::kEventFindReply, args.Pass()));
}
void WebviewFindHelper::EndFindSession(int session_request_id, bool canceled) {
diff --git a/chrome/browser/guestview/webview/webview_find_helper.h b/chrome/browser/guest_view/web_view/web_view_find_helper.h
index a9a2889..d8b26e36 100644
--- a/chrome/browser/guestview/webview/webview_find_helper.h
+++ b/chrome/browser/guest_view/web_view/web_view_find_helper.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_FIND_HELPER_H_
-#define CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_FIND_HELPER_H_
+#ifndef CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_FIND_HELPER_H_
+#define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_FIND_HELPER_H_
#include <map>
#include <vector>
@@ -183,4 +183,4 @@ class WebviewFindHelper {
DISALLOW_COPY_AND_ASSIGN(WebviewFindHelper);
};
-#endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_FIND_HELPER_H_
+#endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_FIND_HELPER_H_
diff --git a/chrome/browser/guestview/webview/webview_guest.cc b/chrome/browser/guest_view/web_view/web_view_guest.cc
index 9a14b4f..5365e1b 100644
--- a/chrome/browser/guestview/webview/webview_guest.cc
+++ b/chrome/browser/guest_view/web_view/web_view_guest.cc
@@ -1,8 +1,8 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/guestview/webview/webview_guest.h"
+#include "chrome/browser/guest_view/web_view/web_view_guest.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/stringprintf.h"
@@ -14,9 +14,9 @@
#include "chrome/browser/extensions/menu_manager.h"
#include "chrome/browser/extensions/script_executor.h"
#include "chrome/browser/favicon/favicon_tab_helper.h"
-#include "chrome/browser/guestview/guestview_constants.h"
-#include "chrome/browser/guestview/webview/webview_constants.h"
-#include "chrome/browser/guestview/webview/webview_permission_types.h"
+#include "chrome/browser/guest_view/guest_view_constants.h"
+#include "chrome/browser/guest_view/web_view/web_view_constants.h"
+#include "chrome/browser/guest_view/web_view/web_view_permission_types.h"
#include "chrome/common/chrome_version_info.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/geolocation_permission_context.h"
@@ -42,7 +42,7 @@
#include "third_party/WebKit/public/web/WebFindOptions.h"
#if defined(ENABLE_PLUGINS)
-#include "chrome/browser/guestview/webview/plugin_permission_helper.h"
+#include "chrome/browser/guest_view/web_view/plugin_permission_helper.h"
#endif
#if defined(OS_CHROMEOS)
@@ -130,7 +130,7 @@ void AttachWebViewHelpers(WebContents* contents) {
WebViewGuest::WebViewGuest(WebContents* guest_web_contents,
const std::string& extension_id)
- : GuestView(guest_web_contents, extension_id),
+ : GuestView<WebViewGuest>(guest_web_contents, extension_id),
WebContentsObserver(guest_web_contents),
script_executor_(new extensions::ScriptExecutor(guest_web_contents,
&script_observers_)),
@@ -162,19 +162,7 @@ WebViewGuest::WebViewGuest(WebContents* guest_web_contents,
}
// static
-WebViewGuest* WebViewGuest::From(int embedder_process_id,
- int guest_instance_id) {
- GuestView* guest = GuestView::From(embedder_process_id, guest_instance_id);
- if (!guest)
- return NULL;
- return guest->AsWebView();
-}
-
-// static
-WebViewGuest* WebViewGuest::FromWebContents(WebContents* contents) {
- GuestView* guest = GuestView::FromWebContents(contents);
- return guest ? guest->AsWebView() : NULL;
-}
+const std::string& WebViewGuest::Type = "webview";
// static.
int WebViewGuest::GetViewInstanceId(WebContents* contents) {
@@ -285,23 +273,11 @@ void WebViewGuest::Attach(WebContents* embedder_web_contents,
SetUserAgentOverride("");
}
- GuestView::Attach(embedder_web_contents, args);
+ GuestViewBase::Attach(embedder_web_contents, args);
AddWebViewToExtensionRendererState();
}
-GuestView::Type WebViewGuest::GetViewType() const {
- return GuestView::WEBVIEW;
-}
-
-WebViewGuest* WebViewGuest::AsWebView() {
- return this;
-}
-
-AdViewGuest* WebViewGuest::AsAdView() {
- return NULL;
-}
-
void WebViewGuest::AddMessageToConsole(int32 level,
const base::string16& message,
int32 line_no,
@@ -313,12 +289,12 @@ void WebViewGuest::AddMessageToConsole(int32 level,
args->SetInteger(webview::kLine, line_no);
args->SetString(webview::kSourceId, source_id);
DispatchEvent(
- new GuestView::Event(webview::kEventConsoleMessage, args.Pass()));
+ new GuestViewBase::Event(webview::kEventConsoleMessage, args.Pass()));
}
void WebViewGuest::Close() {
scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
- DispatchEvent(new GuestView::Event(webview::kEventClose, args.Pass()));
+ DispatchEvent(new GuestViewBase::Event(webview::kEventClose, args.Pass()));
}
void WebViewGuest::DidAttach() {
@@ -363,8 +339,7 @@ void WebViewGuest::GuestProcessGone(base::TerminationStatus status) {
args->SetInteger(webview::kProcessId,
guest_web_contents()->GetRenderProcessHost()->GetID());
args->SetString(webview::kReason, TerminationStatusToString(status));
- DispatchEvent(
- new GuestView::Event(webview::kEventExit, args.Pass()));
+ DispatchEvent(new GuestViewBase::Event(webview::kEventExit, args.Pass()));
}
bool WebViewGuest::HandleKeyboardEvent(
@@ -411,7 +386,8 @@ void WebViewGuest::LoadProgressed(double progress) {
scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
args->SetString(guestview::kUrl, guest_web_contents()->GetURL().spec());
args->SetDouble(webview::kProgress, progress);
- DispatchEvent(new GuestView::Event(webview::kEventLoadProgress, args.Pass()));
+ DispatchEvent(
+ new GuestViewBase::Event(webview::kEventLoadProgress, args.Pass()));
}
void WebViewGuest::LoadAbort(bool is_top_level,
@@ -421,7 +397,8 @@ void WebViewGuest::LoadAbort(bool is_top_level,
args->SetBoolean(guestview::kIsTopLevel, is_top_level);
args->SetString(guestview::kUrl, url.possibly_invalid_spec());
args->SetString(guestview::kReason, error_type);
- DispatchEvent(new GuestView::Event(webview::kEventLoadAbort, args.Pass()));
+ DispatchEvent(
+ new GuestViewBase::Event(webview::kEventLoadAbort, args.Pass()));
}
// TODO(fsamuel): Find a reliable way to test the 'responsive' and
@@ -430,14 +407,16 @@ void WebViewGuest::RendererResponsive() {
scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
args->SetInteger(webview::kProcessId,
guest_web_contents()->GetRenderProcessHost()->GetID());
- DispatchEvent(new GuestView::Event(webview::kEventResponsive, args.Pass()));
+ DispatchEvent(
+ new GuestViewBase::Event(webview::kEventResponsive, args.Pass()));
}
void WebViewGuest::RendererUnresponsive() {
scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
args->SetInteger(webview::kProcessId,
guest_web_contents()->GetRenderProcessHost()->GetID());
- DispatchEvent(new GuestView::Event(webview::kEventUnresponsive, args.Pass()));
+ DispatchEvent(
+ new GuestViewBase::Event(webview::kEventUnresponsive, args.Pass()));
}
void WebViewGuest::RequestPermission(
@@ -487,7 +466,8 @@ void WebViewGuest::SetZoom(double zoom_factor) {
scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
args->SetDouble(webview::kOldZoomFactor, current_zoom_factor_);
args->SetDouble(webview::kNewZoomFactor, zoom_factor);
- DispatchEvent(new GuestView::Event(webview::kEventZoomChange, args.Pass()));
+ DispatchEvent(
+ new GuestViewBase::Event(webview::kEventZoomChange, args.Pass()));
current_zoom_factor_ = zoom_factor;
}
@@ -714,7 +694,8 @@ void WebViewGuest::DidCommitProvisionalLoadForFrame(
guest_web_contents()->GetController().GetEntryCount());
args->SetInteger(webview::kInternalProcessId,
guest_web_contents()->GetRenderProcessHost()->GetID());
- DispatchEvent(new GuestView::Event(webview::kEventLoadCommit, args.Pass()));
+ DispatchEvent(
+ new GuestViewBase::Event(webview::kEventLoadCommit, args.Pass()));
// Update the current zoom factor for the new page.
current_zoom_factor_ = content::ZoomLevelToZoomFactor(
@@ -751,7 +732,8 @@ void WebViewGuest::DidStartProvisionalLoadForFrame(
scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
args->SetString(guestview::kUrl, validated_url.spec());
args->SetBoolean(guestview::kIsTopLevel, is_main_frame);
- DispatchEvent(new GuestView::Event(webview::kEventLoadStart, args.Pass()));
+ DispatchEvent(
+ new GuestViewBase::Event(webview::kEventLoadStart, args.Pass()));
}
void WebViewGuest::DocumentLoadedInFrame(
@@ -763,7 +745,7 @@ void WebViewGuest::DocumentLoadedInFrame(
void WebViewGuest::DidStopLoading(content::RenderViewHost* render_view_host) {
scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
- DispatchEvent(new GuestView::Event(webview::kEventLoadStop, args.Pass()));
+ DispatchEvent(new GuestViewBase::Event(webview::kEventLoadStop, args.Pass()));
}
void WebViewGuest::WebContentsDestroyed(WebContents* web_contents) {
@@ -794,7 +776,8 @@ void WebViewGuest::UserAgentOverrideSet(const std::string& user_agent) {
void WebViewGuest::LoadHandlerCalled() {
scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
- DispatchEvent(new GuestView::Event(webview::kEventContentLoad, args.Pass()));
+ DispatchEvent(
+ new GuestViewBase::Event(webview::kEventContentLoad, args.Pass()));
}
void WebViewGuest::LoadRedirect(const GURL& old_url,
@@ -804,7 +787,8 @@ void WebViewGuest::LoadRedirect(const GURL& old_url,
args->SetBoolean(guestview::kIsTopLevel, is_top_level);
args->SetString(webview::kNewURL, new_url.spec());
args->SetString(webview::kOldURL, old_url.spec());
- DispatchEvent(new GuestView::Event(webview::kEventLoadRedirect, args.Pass()));
+ DispatchEvent(
+ new GuestViewBase::Event(webview::kEventLoadRedirect, args.Pass()));
}
void WebViewGuest::AddWebViewToExtensionRendererState() {
@@ -866,7 +850,8 @@ void WebViewGuest::SizeChanged(const gfx::Size& old_size,
args->SetInteger(webview::kOldWidth, old_size.width());
args->SetInteger(webview::kNewHeight, new_size.height());
args->SetInteger(webview::kNewWidth, new_size.width());
- DispatchEvent(new GuestView::Event(webview::kEventSizeChanged, args.Pass()));
+ DispatchEvent(
+ new GuestViewBase::Event(webview::kEventSizeChanged, args.Pass()));
}
void WebViewGuest::RequestMediaAccessPermission(
@@ -1000,20 +985,20 @@ int WebViewGuest::RequestPermissionInternal(
args->SetInteger(webview::kRequestId, request_id);
switch (static_cast<int>(permission_type)) {
case BROWSER_PLUGIN_PERMISSION_TYPE_NEW_WINDOW: {
- DispatchEvent(new GuestView::Event(webview::kEventNewWindow,
- args.Pass()));
+ DispatchEvent(
+ new GuestViewBase::Event(webview::kEventNewWindow, args.Pass()));
break;
}
case WEB_VIEW_PERMISSION_TYPE_JAVASCRIPT_DIALOG: {
- DispatchEvent(new GuestView::Event(webview::kEventDialog,
- args.Pass()));
+ DispatchEvent(
+ new GuestViewBase::Event(webview::kEventDialog, args.Pass()));
break;
}
default: {
args->SetString(webview::kPermission,
PermissionTypeToString(permission_type));
- DispatchEvent(new GuestView::Event(webview::kEventPermissionRequest,
- args.Pass()));
+ DispatchEvent(new GuestViewBase::Event(webview::kEventPermissionRequest,
+ args.Pass()));
break;
}
}
diff --git a/chrome/browser/guestview/webview/webview_guest.h b/chrome/browser/guest_view/web_view/web_view_guest.h
index 53e2f5a..98c2e31 100644
--- a/chrome/browser/guestview/webview/webview_guest.h
+++ b/chrome/browser/guest_view/web_view/web_view_guest.h
@@ -1,15 +1,15 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_
-#define CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_
+#ifndef CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_
+#define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_
#include "base/observer_list.h"
#include "chrome/browser/extensions/tab_helper.h"
-#include "chrome/browser/guestview/guestview.h"
-#include "chrome/browser/guestview/webview/javascript_dialog_helper.h"
-#include "chrome/browser/guestview/webview/webview_find_helper.h"
+#include "chrome/browser/guest_view/guest_view.h"
+#include "chrome/browser/guest_view/web_view/javascript_dialog_helper.h"
+#include "chrome/browser/guest_view/web_view/web_view_find_helper.h"
#include "content/public/browser/javascript_dialog_manager.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
@@ -31,25 +31,21 @@ class WebviewFindFunction;
// a particular embedder WebContents. This happens on either initial navigation
// or through the use of the New Window API, when a new window is attached to
// a particular <webview>.
-class WebViewGuest : public GuestView,
+class WebViewGuest : public GuestView<WebViewGuest>,
public content::NotificationObserver,
public content::WebContentsObserver {
public:
WebViewGuest(content::WebContents* guest_web_contents,
const std::string& embedder_extension_id);
- static WebViewGuest* From(int embedder_process_id, int instance_id);
- static WebViewGuest* FromWebContents(content::WebContents* contents);
// Returns guestview::kInstanceIDNone if |contents| does not correspond to a
// WebViewGuest.
static int GetViewInstanceId(content::WebContents* contents);
+ static const std::string& Type;
- // GuestView implementation.
+ // GuestViewBase implementation.
virtual void Attach(content::WebContents* embedder_web_contents,
const base::DictionaryValue& args) OVERRIDE;
- virtual GuestView::Type GetViewType() const OVERRIDE;
- virtual WebViewGuest* AsWebView() OVERRIDE;
- virtual AdViewGuest* AsAdView() OVERRIDE;
// GuestDelegate implementation.
virtual void AddMessageToConsole(int32 level,
@@ -324,4 +320,4 @@ class WebViewGuest : public GuestView,
DISALLOW_COPY_AND_ASSIGN(WebViewGuest);
};
-#endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_GUEST_H_
+#endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_
diff --git a/chrome/browser/guestview/webview/webview_permission_types.h b/chrome/browser/guest_view/web_view/web_view_permission_types.h
index a532036..11df574 100644
--- a/chrome/browser/guestview/webview/webview_permission_types.h
+++ b/chrome/browser/guest_view/web_view/web_view_permission_types.h
@@ -1,9 +1,9 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_PERMISSION_TYPES_H_
-#define CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_PERMISSION_TYPES_H_
+#ifndef CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_PERMISSION_TYPES_H_
+#define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_PERMISSION_TYPES_H_
#include "content/public/common/browser_plugin_permission_type.h"
@@ -27,4 +27,4 @@ enum WebViewPermissionType {
WEB_VIEW_PERMISSION_TYPE_POINTER_LOCK
};
-#endif // CHROME_BROWSER_GUESTVIEW_WEBVIEW_WEBVIEW_PERMISSION_TYPES_H_
+#endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_PERMISSION_TYPES_H_
diff --git a/chrome/browser/renderer_context_menu/context_menu_content_type_factory.cc b/chrome/browser/renderer_context_menu/context_menu_content_type_factory.cc
index dfbb878..5641a00 100644
--- a/chrome/browser/renderer_context_menu/context_menu_content_type_factory.cc
+++ b/chrome/browser/renderer_context_menu/context_menu_content_type_factory.cc
@@ -5,8 +5,8 @@
#include "chrome/browser/renderer_context_menu/context_menu_content_type_factory.h"
#include "chrome/browser/app_mode/app_mode_utils.h"
-#include "chrome/browser/guestview/webview/context_menu_content_type_webview.h"
-#include "chrome/browser/guestview/webview/webview_guest.h"
+#include "chrome/browser/guest_view/web_view/context_menu_content_type_web_view.h"
+#include "chrome/browser/guest_view/web_view/web_view_guest.h"
#include "chrome/browser/renderer_context_menu/context_menu_content_type.h"
#include "chrome/browser/renderer_context_menu/context_menu_content_type_app_mode.h"
#include "chrome/browser/renderer_context_menu/context_menu_content_type_extension_popup.h"
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
index 735c456..a2d8ec2 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -35,7 +35,7 @@
#include "chrome/browser/extensions/devtools_util.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/google/google_util.h"
-#include "chrome/browser/guestview/webview/webview_guest.h"
+#include "chrome/browser/guest_view/web_view/web_view_guest.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/profile.h"
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 6ee7fa8..52ea8e4 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -730,27 +730,28 @@
'browser/gpu/gpu_feature_checker.h',
'browser/gpu/gpu_mode_manager.cc',
'browser/gpu/gpu_mode_manager.h',
- 'browser/guestview/adview/adview_constants.cc',
- 'browser/guestview/adview/adview_constants.h',
- 'browser/guestview/adview/adview_guest.cc',
- 'browser/guestview/adview/adview_guest.h',
- 'browser/guestview/guestview_constants.cc',
- 'browser/guestview/guestview_constants.h',
- 'browser/guestview/guestview.cc',
- 'browser/guestview/guestview.h',
- 'browser/guestview/webview/context_menu_content_type_webview.cc',
- 'browser/guestview/webview/context_menu_content_type_webview.h',
- 'browser/guestview/webview/javascript_dialog_helper.cc',
- 'browser/guestview/webview/javascript_dialog_helper.h',
- 'browser/guestview/webview/plugin_permission_helper.cc',
- 'browser/guestview/webview/plugin_permission_helper.h',
- 'browser/guestview/webview/webview_constants.cc',
- 'browser/guestview/webview/webview_constants.h',
- 'browser/guestview/webview/webview_find_helper.cc',
- 'browser/guestview/webview/webview_find_helper.h',
- 'browser/guestview/webview/webview_guest.cc',
- 'browser/guestview/webview/webview_guest.h',
- 'browser/guestview/webview/webview_permission_types.h',
+ 'browser/guest_view/ad_view/ad_view_constants.cc',
+ 'browser/guest_view/ad_view/ad_view_constants.h',
+ 'browser/guest_view/ad_view/ad_view_guest.cc',
+ 'browser/guest_view/ad_view/ad_view_guest.h',
+ 'browser/guest_view/guest_view_constants.cc',
+ 'browser/guest_view/guest_view_constants.h',
+ 'browser/guest_view/guest_view_base.cc',
+ 'browser/guest_view/guest_view_base.h',
+ 'browser/guest_view/guest_view.h',
+ 'browser/guest_view/web_view/context_menu_content_type_web_view.cc',
+ 'browser/guest_view/web_view/context_menu_content_type_web_view.h',
+ 'browser/guest_view/web_view/javascript_dialog_helper.cc',
+ 'browser/guest_view/web_view/javascript_dialog_helper.h',
+ 'browser/guest_view/web_view/plugin_permission_helper.cc',
+ 'browser/guest_view/web_view/plugin_permission_helper.h',
+ 'browser/guest_view/web_view/web_view_constants.cc',
+ 'browser/guest_view/web_view/web_view_constants.h',
+ 'browser/guest_view/web_view/web_view_find_helper.cc',
+ 'browser/guest_view/web_view/web_view_find_helper.h',
+ 'browser/guest_view/web_view/web_view_guest.cc',
+ 'browser/guest_view/web_view/web_view_guest.h',
+ 'browser/guest_view/web_view/web_view_permission_types.h',
'browser/hang_monitor/hang_crash_dump_win.cc',
'browser/hang_monitor/hang_crash_dump_win.h',
'browser/hang_monitor/hung_plugin_action.cc',
@@ -2841,7 +2842,7 @@
],
}, { # enable_plugins==0
'sources/': [
- ['exclude', '^browser/guestview/webview/plugin_permission_helper'],
+ ['exclude', '^browser/guest_view/web_view/plugin_permission_helper'],
['exclude', '^browser/pepper_'],
['exclude', '^browser/plugins/'],
['exclude', '^browser/renderer_host/pepper/'],