diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-11 18:13:21 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-11 18:13:21 +0000 |
commit | e091df891e7e86d0b7fdbfba7e784b9094aed09f (patch) | |
tree | d3ddf7cba52bd2c145f360efb81fc0dfc7b298a6 /chrome | |
parent | a867a7ed5b258420d4eafd416e4d295a87af0de0 (diff) | |
download | chromium_src-e091df891e7e86d0b7fdbfba7e784b9094aed09f.zip chromium_src-e091df891e7e86d0b7fdbfba7e784b9094aed09f.tar.gz chromium_src-e091df891e7e86d0b7fdbfba7e784b9094aed09f.tar.bz2 |
Move BindingsPolicy enum to content\public\common and put it in the content namespace. I've also renamed the value names to match the style that we use in the WebKit API (i.e. all values in an enum start with the enum's name) since it's more readable. As we move other enums to public we should switch them over as well.
BUG=98716
Review URL: http://codereview.chromium.org/8220024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104917 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/DEPS | 1 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/web_page_view.cc | 2 | ||||
-rw-r--r-- | chrome/browser/debugger/devtools_window.cc | 5 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_host.cc | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_web_ui.cc | 4 | ||||
-rw-r--r-- | chrome/browser/external_tab_container_win.cc | 4 | ||||
-rw-r--r-- | chrome/browser/memory_details.cc | 4 | ||||
-rw-r--r-- | chrome/browser/notifications/balloon_host.cc | 4 | ||||
-rw-r--r-- | chrome/browser/renderer_host/chrome_render_view_host_observer.cc | 1 | ||||
-rw-r--r-- | chrome/browser/tab_contents/web_contents_unittest.cc | 8 | ||||
-rw-r--r-- | chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/webui/html_dialog_ui.cc | 6 | ||||
-rw-r--r-- | chrome/renderer/chrome_render_view_observer.cc | 14 |
13 files changed, 31 insertions, 30 deletions
diff --git a/chrome/DEPS b/chrome/DEPS index 4d20732..2580f54 100644 --- a/chrome/DEPS +++ b/chrome/DEPS @@ -13,6 +13,7 @@ include_rules = [ "+chrome/test", "-content", "+content/common", + "+content/public/common", "+content/test", # Don't allow inclusion of these other libs we shouldn't be calling directly. diff --git a/chrome/browser/chromeos/login/web_page_view.cc b/chrome/browser/chromeos/login/web_page_view.cc index 9f8e79d..d6f78ee 100644 --- a/chrome/browser/chromeos/login/web_page_view.cc +++ b/chrome/browser/chromeos/login/web_page_view.cc @@ -15,7 +15,7 @@ #include "content/browser/child_process_security_policy.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/webui/web_ui.h" -#include "content/common/bindings_policy.h" +#include "content/public/common/bindings_policy.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "ipc/ipc_message.h" diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc index d896519..a71e4f0 100644 --- a/chrome/browser/debugger/devtools_window.cc +++ b/chrome/browser/debugger/devtools_window.cc @@ -39,9 +39,9 @@ #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" -#include "content/common/bindings_policy.h" #include "content/common/devtools_messages.h" #include "content/common/notification_service.h" +#include "content/public/common/bindings_policy.h" #include "grit/generated_resources.h" const char DevToolsWindow::kDevToolsApp[] = "DevToolsApp"; @@ -121,7 +121,8 @@ DevToolsWindow* DevToolsWindow::Create( // Create TabContents with devtools. TabContentsWrapper* tab_contents = Browser::TabContentsFactory(profile, NULL, MSG_ROUTING_NONE, NULL, NULL); - tab_contents->render_view_host()->AllowBindings(BindingsPolicy::WEB_UI); + tab_contents->render_view_host()->AllowBindings( + content::BINDINGS_POLICY_WEB_UI); tab_contents->controller().LoadURL( GetDevToolsUrl(profile, docked, shared_worker_frontend), GURL(), diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index 50e2642..0902ba7 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -44,11 +44,11 @@ #include "content/browser/tab_contents/popup_menu_helper_mac.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" -#include "content/common/bindings_policy.h" #include "content/common/content_client.h" #include "content/common/native_web_keyboard_event.h" #include "content/common/notification_service.h" #include "content/common/view_messages.h" +#include "content/public/common/bindings_policy.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -145,7 +145,7 @@ ExtensionHost::ExtensionHost(const Extension* extension, render_view_host_ = new RenderViewHost(site_instance, this, MSG_ROUTING_NONE, NULL); if (enable_dom_automation_) - render_view_host_->AllowBindings(BindingsPolicy::DOM_AUTOMATION); + render_view_host_->AllowBindings(content::BINDINGS_POLICY_DOM_AUTOMATION); // Listen for when the render process' handle is available so we can add it // to the task manager then. diff --git a/chrome/browser/extensions/extension_web_ui.cc b/chrome/browser/extensions/extension_web_ui.cc index eeca442..2a14e58 100644 --- a/chrome/browser/extensions/extension_web_ui.cc +++ b/chrome/browser/extensions/extension_web_ui.cc @@ -25,8 +25,8 @@ #include "chrome/common/extensions/extension_resource.h" #include "chrome/common/url_constants.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/common/bindings_policy.h" #include "content/common/page_transition_types.h" +#include "content/public/common/bindings_policy.h" #include "net/base/file_stream.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/gfx/codec/png_codec.h" @@ -145,7 +145,7 @@ ExtensionWebUI::ExtensionWebUI(TabContents* tab_contents, const GURL& url) // Bind externalHost to Extension WebUI loaded in Chrome Frame. const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); if (browser_command_line.HasSwitch(switches::kChromeFrame)) - bindings_ |= BindingsPolicy::EXTERNAL_HOST; + bindings_ |= content::BINDINGS_POLICY_EXTERNAL_HOST; // For chrome:// overrides, some of the defaults are a little different. GURL effective_url = tab_contents->GetURL(); if (effective_url.SchemeIs(chrome::kChromeUIScheme)) { diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index c7905c3..14799d7c 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -43,12 +43,12 @@ #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" #include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/provisional_load_details.h" -#include "content/common/bindings_policy.h" #include "content/common/native_web_keyboard_event.h" #include "content/common/notification_service.h" #include "content/common/page_transition_types.h" #include "content/common/page_zoom.h" #include "content/common/view_messages.h" +#include "content/public/common/bindings_policy.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "ui/base/l10n/l10n_util.h" @@ -204,7 +204,7 @@ bool ExternalTabContainer::Init(Profile* profile, if (!existing_contents) { tab_contents_->render_view_host()->AllowBindings( - BindingsPolicy::EXTERNAL_HOST); + content::BINDINGS_POLICY_EXTERNAL_HOST); } NavigationController* controller = &tab_contents_->controller(); diff --git a/chrome/browser/memory_details.cc b/chrome/browser/memory_details.cc index 8d7faf1..fd49b30 100644 --- a/chrome/browser/memory_details.cc +++ b/chrome/browser/memory_details.cc @@ -22,7 +22,7 @@ #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/common/bindings_policy.h" +#include "content/public/common/bindings_policy.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -165,7 +165,7 @@ void MemoryDetails::CollectChildInfoOnUIThread() { DCHECK(host_delegate); GURL url = host_delegate->GetURL(); content::ViewType::Type type = host_delegate->GetRenderViewType(); - if (host->enabled_bindings() & BindingsPolicy::WEB_UI) { + if (host->enabled_bindings() & content::BINDINGS_POLICY_WEB_UI) { // TODO(erikkay) the type for devtools doesn't actually appear to // be set. if (type == content::ViewType::DEV_TOOLS_UI) diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc index 3f39566..7d412ec 100644 --- a/chrome/browser/notifications/balloon_host.cc +++ b/chrome/browser/notifications/balloon_host.cc @@ -17,11 +17,11 @@ #include "content/browser/renderer_host/browser_render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/site_instance.h" -#include "content/common/bindings_policy.h" #include "content/common/notification_service.h" #include "content/common/notification_source.h" #include "content/common/renderer_preferences.h" #include "content/common/view_messages.h" +#include "content/public/common/bindings_policy.h" #include "ipc/ipc_message.h" #include "webkit/glue/webpreferences.h" @@ -178,7 +178,7 @@ void BalloonHost::Init() { RenderViewHost* rvh = new RenderViewHost( site_instance_.get(), this, MSG_ROUTING_NONE, NULL); if (enable_web_ui_) - rvh->AllowBindings(BindingsPolicy::WEB_UI); + rvh->AllowBindings(content::BINDINGS_POLICY_WEB_UI); // Do platform-specific initialization. render_view_host_ = rvh; diff --git a/chrome/browser/renderer_host/chrome_render_view_host_observer.cc b/chrome/browser/renderer_host/chrome_render_view_host_observer.cc index db5c193..8945f04 100644 --- a/chrome/browser/renderer_host/chrome_render_view_host_observer.cc +++ b/chrome/browser/renderer_host/chrome_render_view_host_observer.cc @@ -19,7 +19,6 @@ #include "content/browser/renderer_host/render_view_host_delegate.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/site_instance.h" -#include "content/common/bindings_policy.h" #include "content/common/notification_service.h" #include "content/common/view_messages.h" diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index 3de88e9..29d2676 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -21,11 +21,11 @@ #include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/test_tab_contents.h" -#include "content/common/bindings_policy.h" #include "content/common/content_constants.h" #include "content/common/notification_service.h" #include "content/common/notification_source.h" #include "content/common/view_messages.h" +#include "content/public/common/bindings_policy.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/message_box_flags.h" #include "webkit/glue/webkit_glue.h" @@ -610,7 +610,7 @@ TEST_F(TabContentsTest, CrossSiteNavigationBackPreempted) { EXPECT_EQ(ntp_rvh, contents()->render_view_host()); EXPECT_EQ(url1, entry1->url()); EXPECT_EQ(instance1, entry1->site_instance()); - EXPECT_TRUE(BindingsPolicy::is_web_ui_enabled(ntp_rvh->enabled_bindings())); + EXPECT_TRUE(ntp_rvh->enabled_bindings() & content::BINDINGS_POLICY_WEB_UI); // Navigate to new site. const GURL url2("http://www.google.com"); @@ -635,8 +635,8 @@ TEST_F(TabContentsTest, CrossSiteNavigationBackPreempted) { EXPECT_FALSE(contents()->pending_rvh()); EXPECT_EQ(url2, entry2->url()); EXPECT_EQ(instance2, entry2->site_instance()); - EXPECT_FALSE(BindingsPolicy::is_web_ui_enabled( - google_rvh->enabled_bindings())); + EXPECT_FALSE(google_rvh->enabled_bindings() & + content::BINDINGS_POLICY_WEB_UI); // Navigate to third page on same site. const GURL url3("http://news.google.com"); diff --git a/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc b/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc index ea34265..b7d461f 100644 --- a/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc +++ b/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc @@ -18,7 +18,7 @@ #include "chrome/common/url_constants.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/common/bindings_policy.h" +#include "content/public/common/bindings_policy.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -159,7 +159,7 @@ EnterpriseEnrollmentUI::~EnterpriseEnrollmentUI() {} void EnterpriseEnrollmentUI::RenderViewCreated( RenderViewHost* render_view_host) { // Bail out early if web ui is disabled. - if (!(bindings_ & BindingsPolicy::WEB_UI)) + if (!(bindings_ & content::BINDINGS_POLICY_WEB_UI)) return; handler_ = new SingleEnterpriseEnrollmentScreenHandler(); diff --git a/chrome/browser/ui/webui/html_dialog_ui.cc b/chrome/browser/ui/webui/html_dialog_ui.cc index d6dc51a5..ca071a3 100644 --- a/chrome/browser/ui/webui/html_dialog_ui.cc +++ b/chrome/browser/ui/webui/html_dialog_ui.cc @@ -11,8 +11,8 @@ #include "chrome/common/chrome_notification_types.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/common/bindings_policy.h" #include "content/common/notification_service.h" +#include "content/public/common/bindings_policy.h" static base::LazyInstance<PropertyAccessor<HtmlDialogUIDelegate*> > g_html_dialog_ui_property_accessor(base::LINKER_INITIALIZED); @@ -60,7 +60,7 @@ void HtmlDialogUI::RenderViewCreated(RenderViewHost* render_view_host) { (*delegate)->GetWebUIMessageHandlers(&handlers); } - if (0 != (bindings_ & BindingsPolicy::WEB_UI)) + if (0 != (bindings_ & content::BINDINGS_POLICY_WEB_UI)) render_view_host->SetWebUIProperty("dialogArguments", dialog_args); for (std::vector<WebUIMessageHandler*>::iterator it = handlers.begin(); it != handlers.end(); ++it) { @@ -92,7 +92,7 @@ ExternalHtmlDialogUI::ExternalHtmlDialogUI(TabContents* tab_contents) // for security reasons. The code hosting the dialog should provide // dialog specific functionality through other bindings and methods // that are scoped in duration to the dialogs existence. - bindings_ &= ~BindingsPolicy::WEB_UI; + bindings_ &= ~content::BINDINGS_POLICY_WEB_UI; } ExternalHtmlDialogUI::~ExternalHtmlDialogUI() { diff --git a/chrome/renderer/chrome_render_view_observer.cc b/chrome/renderer/chrome_render_view_observer.cc index ec5b610..39dc76d 100644 --- a/chrome/renderer/chrome_render_view_observer.cc +++ b/chrome/renderer/chrome_render_view_observer.cc @@ -25,8 +25,8 @@ #include "chrome/renderer/prerender/prerender_helper.h" #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" #include "chrome/renderer/translate_helper.h" -#include "content/common/bindings_policy.h" #include "content/common/view_messages.h" +#include "content/public/common/bindings_policy.h" #include "content/public/renderer/render_view.h" #include "content/public/renderer/content_renderer_client.h" #include "net/base/data_url.h" @@ -233,7 +233,7 @@ ChromeRenderViewObserver::ChromeRenderViewObserver( if (command_line.HasSwitch(switches::kDomAutomationController)) { int old_bindings = render_view->GetEnabledBindings(); render_view->SetEnabledBindings( - old_bindings |= BindingsPolicy::DOM_AUTOMATION); + old_bindings |= content::BINDINGS_POLICY_DOM_AUTOMATION); } render_view->GetWebView()->setPermissionClient(this); if (!command_line.HasSwitch(switches::kDisableClientSidePhishingDetection)) @@ -665,7 +665,7 @@ void ChromeRenderViewObserver::OnSetIsPrerendering(bool is_prerendering) { } void ChromeRenderViewObserver::DidStartLoading() { - if (BindingsPolicy::is_web_ui_enabled(render_view()->GetEnabledBindings()) && + if ((render_view()->GetEnabledBindings() & content::BINDINGS_POLICY_WEB_UI) && webui_javascript_.get()) { render_view()->EvaluateScript(webui_javascript_->frame_xpath, webui_javascript_->jscript, @@ -743,13 +743,13 @@ void ChromeRenderViewObserver::DidCommitProvisionalLoad( } void ChromeRenderViewObserver::DidClearWindowObject(WebFrame* frame) { - if (BindingsPolicy::is_dom_automation_enabled( - render_view()->GetEnabledBindings())) { + if (render_view()->GetEnabledBindings() & + content::BINDINGS_POLICY_DOM_AUTOMATION) { BindDOMAutomationController(frame); } - if (BindingsPolicy::is_external_host_enabled( - render_view()->GetEnabledBindings())) { + if (render_view()->GetEnabledBindings() & + content::BINDINGS_POLICY_EXTERNAL_HOST) { GetExternalHostBindings()->BindToJavascript(frame, "externalHost"); } } |