diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 01:17:27 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 01:17:27 +0000 |
commit | c50008518aa19574ce694d280d3a7947dd150d91 (patch) | |
tree | 4206aed59cc75943e6255a2161ba7364463b1242 /chrome | |
parent | fb3d0321d7aa47b273a50d4ac8e9e92c791f81b9 (diff) | |
download | chromium_src-c50008518aa19574ce694d280d3a7947dd150d91.zip chromium_src-c50008518aa19574ce694d280d3a7947dd150d91.tar.gz chromium_src-c50008518aa19574ce694d280d3a7947dd150d91.tar.bz2 |
WebUI: Rename DOMUIBindings to WebUIBindings.
BUG=59945
TEST=trybots
Review URL: http://codereview.chromium.org/6368061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73570 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/child_process_security_policy.cc | 6 | ||||
-rw-r--r-- | chrome/browser/child_process_security_policy.h | 12 | ||||
-rw-r--r-- | chrome/browser/child_process_security_policy_unittest.cc | 14 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_process_host.cc | 4 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.cc | 6 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.h | 2 | ||||
-rw-r--r-- | chrome/browser/renderer_host/test/site_instance_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/resources/extensions_ui.html | 2 | ||||
-rw-r--r-- | chrome/browser/resources/options/certificate_edit_ca_trust_overlay.js | 6 | ||||
-rw-r--r-- | chrome/chrome_renderer.gypi | 6 | ||||
-rw-r--r-- | chrome/renderer/external_host_bindings.h | 4 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 18 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 6 | ||||
-rw-r--r-- | chrome/renderer/web_ui_bindings.cc (renamed from chrome/renderer/dom_ui_bindings.cc) | 10 | ||||
-rw-r--r-- | chrome/renderer/web_ui_bindings.h (renamed from chrome/renderer/dom_ui_bindings.h) | 18 |
15 files changed, 59 insertions, 59 deletions
diff --git a/chrome/browser/child_process_security_policy.cc b/chrome/browser/child_process_security_policy.cc index 5b309ba..94abd67 100644 --- a/chrome/browser/child_process_security_policy.cc +++ b/chrome/browser/child_process_security_policy.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -273,7 +273,7 @@ void ChildProcessSecurityPolicy::GrantScheme(int child_id, state->second->GrantScheme(scheme); } -void ChildProcessSecurityPolicy::GrantDOMUIBindings(int child_id) { +void ChildProcessSecurityPolicy::GrantWebUIBindings(int child_id) { base::AutoLock lock(lock_); SecurityStateMap::iterator state = security_state_.find(child_id); @@ -382,7 +382,7 @@ bool ChildProcessSecurityPolicy::HasPermissionsForFile( return state->second->HasPermissionsForFile(file, permissions); } -bool ChildProcessSecurityPolicy::HasDOMUIBindings(int child_id) { +bool ChildProcessSecurityPolicy::HasWebUIBindings(int child_id) { base::AutoLock lock(lock_); SecurityStateMap::iterator state = security_state_.find(child_id); diff --git a/chrome/browser/child_process_security_policy.h b/chrome/browser/child_process_security_policy.h index 5dbd6ee..9a99698 100644 --- a/chrome/browser/child_process_security_policy.h +++ b/chrome/browser/child_process_security_policy.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -85,7 +85,7 @@ class ChildProcessSecurityPolicy { void GrantScheme(int child_id, const std::string& scheme); // Grant the child process the ability to use Web UI Bindings. - void GrantDOMUIBindings(int child_id); + void GrantWebUIBindings(int child_id); // Grant the child process the ability to use extension Bindings. void GrantExtensionBindings(int child_id); @@ -112,12 +112,12 @@ class ChildProcessSecurityPolicy { const FilePath& file, int permissions); - // Returns true if the specified child_id has been granted DOMUIBindings. + // Returns true if the specified child_id has been granted WebUIBindings. // The browser should check this property before assuming the child process is - // allowed to use DOMUIBindings. - bool HasDOMUIBindings(int child_id); + // allowed to use WebUIBindings. + bool HasWebUIBindings(int child_id); - // Returns true if the specified child_id has been granted DOMUIBindings. + // Returns true if the specified child_id has been granted WebUIBindings. // The browser should check this property before assuming the child process is // allowed to use extension bindings. bool HasExtensionBindings(int child_id); diff --git a/chrome/browser/child_process_security_policy_unittest.cc b/chrome/browser/child_process_security_policy_unittest.cc index 5ab84a9..9910b45 100644 --- a/chrome/browser/child_process_security_policy_unittest.cc +++ b/chrome/browser/child_process_security_policy_unittest.cc @@ -288,17 +288,17 @@ TEST_F(ChildProcessSecurityPolicyTest, FilePermissions) { p->Remove(kRendererID); } -TEST_F(ChildProcessSecurityPolicyTest, CanServiceDOMUIBindings) { +TEST_F(ChildProcessSecurityPolicyTest, CanServiceWebUIBindings) { ChildProcessSecurityPolicy* p = ChildProcessSecurityPolicy::GetInstance(); GURL url("chrome://thumb/http://www.google.com/"); p->Add(kRendererID); - EXPECT_FALSE(p->HasDOMUIBindings(kRendererID)); + EXPECT_FALSE(p->HasWebUIBindings(kRendererID)); EXPECT_FALSE(p->CanRequestURL(kRendererID, url)); - p->GrantDOMUIBindings(kRendererID); - EXPECT_TRUE(p->HasDOMUIBindings(kRendererID)); + p->GrantWebUIBindings(kRendererID); + EXPECT_TRUE(p->HasWebUIBindings(kRendererID)); EXPECT_TRUE(p->CanRequestURL(kRendererID, url)); p->Remove(kRendererID); @@ -314,11 +314,11 @@ TEST_F(ChildProcessSecurityPolicyTest, RemoveRace) { p->GrantRequestURL(kRendererID, url); p->GrantReadFile(kRendererID, file); - p->GrantDOMUIBindings(kRendererID); + p->GrantWebUIBindings(kRendererID); EXPECT_TRUE(p->CanRequestURL(kRendererID, url)); EXPECT_TRUE(p->CanReadFile(kRendererID, file)); - EXPECT_TRUE(p->HasDOMUIBindings(kRendererID)); + EXPECT_TRUE(p->HasWebUIBindings(kRendererID)); p->Remove(kRendererID); @@ -329,5 +329,5 @@ TEST_F(ChildProcessSecurityPolicyTest, RemoveRace) { // In this case, we default to secure behavior. EXPECT_FALSE(p->CanRequestURL(kRendererID, url)); EXPECT_FALSE(p->CanReadFile(kRendererID, file)); - EXPECT_FALSE(p->HasDOMUIBindings(kRendererID)); + EXPECT_FALSE(p->HasWebUIBindings(kRendererID)); } diff --git a/chrome/browser/renderer_host/render_process_host.cc b/chrome/browser/renderer_host/render_process_host.cc index a2c328c..aca5ddb 100644 --- a/chrome/browser/renderer_host/render_process_host.cc +++ b/chrome/browser/renderer_host/render_process_host.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -65,7 +65,7 @@ static bool IsSuitableHost(RenderProcessHost* host, Profile* profile, return false; RenderProcessHost::Type host_type = RenderProcessHost::TYPE_NORMAL; - if (ChildProcessSecurityPolicy::GetInstance()->HasDOMUIBindings(host->id())) + if (ChildProcessSecurityPolicy::GetInstance()->HasWebUIBindings(host->id())) host_type = RenderProcessHost::TYPE_DOMUI; if (ChildProcessSecurityPolicy::GetInstance()-> HasExtensionBindings(host->id())) diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index b5ea89e..3c84f8c 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -143,7 +143,7 @@ bool RenderViewHost::CreateRenderView(const string16& frame_name) { DCHECK(process()->profile()); if (BindingsPolicy::is_dom_ui_enabled(enabled_bindings_)) { - ChildProcessSecurityPolicy::GetInstance()->GrantDOMUIBindings( + ChildProcessSecurityPolicy::GetInstance()->GrantWebUIBindings( process()->id()); } @@ -1126,8 +1126,8 @@ void RenderViewHost::OnMsgDOMUISend( const GURL& source_url, const std::string& message, const std::string& content) { if (!ChildProcessSecurityPolicy::GetInstance()-> - HasDOMUIBindings(process()->id())) { - NOTREACHED() << "Blocked unauthorized use of DOMUIBindings."; + HasWebUIBindings(process()->id())) { + NOTREACHED() << "Blocked unauthorized use of WebUIBindings."; return; } diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 7dda546..5ceddd7 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -359,7 +359,7 @@ class RenderViewHost : public RenderWidgetHost { } // Sets a property with the given name and value on the Web UI binding object. - // Must call AllowDOMUIBindings() on this renderer first. + // Must call AllowWebUIBindings() on this renderer first. void SetDOMUIProperty(const std::string& name, const std::string& value); // Tells the renderer view to focus the first (last if reverse is true) node. diff --git a/chrome/browser/renderer_host/test/site_instance_unittest.cc b/chrome/browser/renderer_host/test/site_instance_unittest.cc index fb0e2da..04ff608 100644 --- a/chrome/browser/renderer_host/test/site_instance_unittest.cc +++ b/chrome/browser/renderer_host/test/site_instance_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -442,7 +442,7 @@ TEST_F(SiteInstanceTest, ProcessSharingByType) { // Create some DOMUI instances and make sure they share a process. scoped_refptr<SiteInstance> dom1_instance( CreateSiteInstance(&rph_factory, GURL("chrome://newtab"))); - policy->GrantDOMUIBindings(dom1_instance->GetProcess()->id()); + policy->GrantWebUIBindings(dom1_instance->GetProcess()->id()); scoped_refptr<SiteInstance> dom2_instance( CreateSiteInstance(&rph_factory, GURL("chrome://history"))); diff --git a/chrome/browser/resources/extensions_ui.html b/chrome/browser/resources/extensions_ui.html index 5e92d43..cdcd5b0 100644 --- a/chrome/browser/resources/extensions_ui.html +++ b/chrome/browser/resources/extensions_ui.html @@ -535,7 +535,7 @@ function returnExtensionsData(extensionsData){ * Tell the C++ ExtensionDOMHandler to inspect the page detailed in |viewData|. */ function sendInspectMessage(viewData) { - // TODO(aa): This is ghetto, but DOMUIBindings doesn't support sending + // TODO(aa): This is ghetto, but WebUIBindings doesn't support sending // anything other than arrays of strings, and this is all going to get // replaced with V8 extensions soon anyway. chrome.send('inspect', [ diff --git a/chrome/browser/resources/options/certificate_edit_ca_trust_overlay.js b/chrome/browser/resources/options/certificate_edit_ca_trust_overlay.js index bcea4e3..98bc282 100644 --- a/chrome/browser/resources/options/certificate_edit_ca_trust_overlay.js +++ b/chrome/browser/resources/options/certificate_edit_ca_trust_overlay.js @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -49,7 +49,7 @@ cr.define('options', function() { */ finishEdit_: function() { // TODO(mattm): Send checked values as booleans. For now send them as - // strings, since DOMUIBindings::send does not support any other types :( + // strings, since WebUIBindings::send does not support any other types :( chrome.send('editCaCertificateTrust', [this.certId, $('certificateCaTrustSSLCheckbox').checked.toString(), @@ -74,7 +74,7 @@ cr.define('options', function() { */ finishImport_: function() { // TODO(mattm): Send checked values as booleans. For now send them as - // strings, since DOMUIBindings::send does not support any other types :( + // strings, since WebUIBindings::send does not support any other types :( chrome.send('importCaCertificateTrustSelected', [$('certificateCaTrustSSLCheckbox').checked.toString(), $('certificateCaTrustEmailCheckbox').checked.toString(), diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi index 50f88d1..055645b 100644 --- a/chrome/chrome_renderer.gypi +++ b/chrome/chrome_renderer.gypi @@ -1,4 +1,4 @@ -# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Copyright (c) 2011 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. @@ -104,8 +104,6 @@ 'renderer/devtools_agent_filter.h', 'renderer/devtools_client.cc', 'renderer/devtools_client.h', - 'renderer/dom_ui_bindings.cc', - 'renderer/dom_ui_bindings.h', 'renderer/extension_groups.h', 'renderer/external_host_bindings.cc', 'renderer/external_host_bindings.h', @@ -243,6 +241,8 @@ 'renderer/user_script_slave.h', 'renderer/visitedlink_slave.cc', 'renderer/visitedlink_slave.h', + 'renderer/web_ui_bindings.cc', + 'renderer/web_ui_bindings.h', 'renderer/webgraphicscontext3d_command_buffer_impl.cc', 'renderer/webgraphicscontext3d_command_buffer_impl.h', 'renderer/webplugin_delegate_proxy.cc', diff --git a/chrome/renderer/external_host_bindings.h b/chrome/renderer/external_host_bindings.h index 12bc001..13b354a 100644 --- a/chrome/renderer/external_host_bindings.h +++ b/chrome/renderer/external_host_bindings.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -6,7 +6,7 @@ #define CHROME_RENDERER_EXTERNAL_HOST_BINDINGS_H_ #pragma once -#include "chrome/renderer/dom_ui_bindings.h" +#include "chrome/renderer/web_ui_bindings.h" #include "ipc/ipc_message.h" // ExternalHostBindings is the class backing the "externalHost" object diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 67b33c5..4de9a22 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -56,7 +56,6 @@ #include "chrome/renderer/device_orientation_dispatcher.h" #include "chrome/renderer/devtools_agent.h" #include "chrome/renderer/devtools_client.h" -#include "chrome/renderer/dom_ui_bindings.h" #include "chrome/renderer/extension_groups.h" #include "chrome/renderer/extensions/bindings_utils.h" #include "chrome/renderer/extensions/event_bindings.h" @@ -92,6 +91,7 @@ #include "chrome/renderer/user_script_idle_scheduler.h" #include "chrome/renderer/user_script_slave.h" #include "chrome/renderer/visitedlink_slave.h" +#include "chrome/renderer/web_ui_bindings.h" #include "chrome/renderer/webgraphicscontext3d_command_buffer_impl.h" #include "chrome/renderer/webplugin_delegate_pepper.h" #include "chrome/renderer/webplugin_delegate_proxy.h" @@ -3449,9 +3449,9 @@ void RenderView::didClearWindowObject(WebFrame* frame) { (frame_url.SchemeIs(chrome::kChromeUIScheme) || frame_url.SchemeIs(chrome::kGearsScheme) || frame_url.SchemeIs(chrome::kDataScheme))) { - GetDOMUIBindings()->set_message_sender(this); - GetDOMUIBindings()->set_routing_id(routing_id_); - GetDOMUIBindings()->BindToJavascript(frame, "chrome"); + GetWebUIBindings()->set_message_sender(this); + GetWebUIBindings()->set_routing_id(routing_id_); + GetWebUIBindings()->BindToJavascript(frame, "chrome"); } if (BindingsPolicy::is_external_host_enabled(enabled_bindings_)) { GetExternalHostBindings()->set_message_sender(this); @@ -4166,11 +4166,11 @@ GURL RenderView::GetAlternateErrorPageURL(const GURL& failed_url, return url; } -DOMUIBindings* RenderView::GetDOMUIBindings() { - if (!dom_ui_bindings_.get()) { - dom_ui_bindings_.reset(new DOMUIBindings()); +WebUIBindings* RenderView::GetWebUIBindings() { + if (!web_ui_bindings_.get()) { + web_ui_bindings_.reset(new WebUIBindings()); } - return dom_ui_bindings_.get(); + return web_ui_bindings_.get(); } ExternalHostBindings* RenderView::GetExternalHostBindings() { @@ -4614,7 +4614,7 @@ void RenderView::OnAllowBindings(int enabled_bindings_flags) { void RenderView::OnSetDOMUIProperty(const std::string& name, const std::string& value) { DCHECK(BindingsPolicy::is_dom_ui_enabled(enabled_bindings_)); - GetDOMUIBindings()->SetProperty(name, value); + GetWebUIBindings()->SetProperty(name, value); } void RenderView::OnReservePageIDRange(int size_of_range) { diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index 6cf1727..2540ba0 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -61,7 +61,7 @@ class DeviceOrientationDispatcher; class DevToolsAgent; class DevToolsClient; class DomAutomationController; -class DOMUIBindings; +class WebUIBindings; class ExternalHostBindings; class FilePath; class GeolocationDispatcher; @@ -1057,7 +1057,7 @@ class RenderView : public RenderWidget, // Locates a sub frame with given xpath WebKit::WebFrame* GetChildFrame(const std::wstring& frame_xpath) const; - DOMUIBindings* GetDOMUIBindings(); + WebUIBindings* GetWebUIBindings(); ExternalHostBindings* GetExternalHostBindings(); @@ -1445,7 +1445,7 @@ class RenderView : public RenderWidget, // Allows Web UI pages (new tab page, etc.) to talk to the browser. The JS // object is only exposed when Web UI bindings are enabled. - scoped_ptr<DOMUIBindings> dom_ui_bindings_; + scoped_ptr<WebUIBindings> web_ui_bindings_; // External host exposed through automation controller. scoped_ptr<ExternalHostBindings> external_host_bindings_; diff --git a/chrome/renderer/dom_ui_bindings.cc b/chrome/renderer/web_ui_bindings.cc index a938f03..69a2d98 100644 --- a/chrome/renderer/dom_ui_bindings.cc +++ b/chrome/renderer/web_ui_bindings.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/renderer/dom_ui_bindings.h" +#include "chrome/renderer/web_ui_bindings.h" #include "base/json/json_writer.h" #include "base/scoped_ptr.h" @@ -52,13 +52,13 @@ DOMBoundBrowserObject::~DOMBoundBrowserObject() { STLDeleteContainerPointers(properties_.begin(), properties_.end()); } -DOMUIBindings::DOMUIBindings() { - BindMethod("send", &DOMUIBindings::send); +WebUIBindings::WebUIBindings() { + BindMethod("send", &WebUIBindings::send); } -DOMUIBindings::~DOMUIBindings() {} +WebUIBindings::~WebUIBindings() {} -void DOMUIBindings::send(const CppArgumentList& args, CppVariant* result) { +void WebUIBindings::send(const CppArgumentList& args, CppVariant* result) { // We expect at least a string message identifier, and optionally take // an object parameter. If we get anything else we bail. if (args.size() < 1 || args.size() > 2) diff --git a/chrome/renderer/dom_ui_bindings.h b/chrome/renderer/web_ui_bindings.h index f2fdb71..8f5841c 100644 --- a/chrome/renderer/dom_ui_bindings.h +++ b/chrome/renderer/web_ui_bindings.h @@ -1,9 +1,9 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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_RENDERER_DOM_UI_BINDINGS_H_ -#define CHROME_RENDERER_DOM_UI_BINDINGS_H_ +#ifndef CHROME_RENDERER_WEB_UI_BINDINGS_H_ +#define CHROME_RENDERER_WEB_UI_BINDINGS_H_ #pragma once #include "ipc/ipc_message.h" @@ -47,22 +47,22 @@ class DOMBoundBrowserObject : public CppBoundClass { DISALLOW_COPY_AND_ASSIGN(DOMBoundBrowserObject); }; -// DOMUIBindings is the class backing the "chrome" object accessible +// WebUIBindings is the class backing the "chrome" object accessible // from Javascript from privileged pages. // // We expose one function, for sending a message to the browser: // send(String name, Object argument); // It's plumbed through to the OnDOMUIMessage callback on RenderViewHost // delegate. -class DOMUIBindings : public DOMBoundBrowserObject { +class WebUIBindings : public DOMBoundBrowserObject { public: - DOMUIBindings(); - virtual ~DOMUIBindings(); + WebUIBindings(); + virtual ~WebUIBindings(); // The send() function provided to Javascript. void send(const CppArgumentList& args, CppVariant* result); private: - DISALLOW_COPY_AND_ASSIGN(DOMUIBindings); + DISALLOW_COPY_AND_ASSIGN(WebUIBindings); }; -#endif // CHROME_RENDERER_DOM_UI_BINDINGS_H_ +#endif // CHROME_RENDERER_WEB_UI_BINDINGS_H_ |