Re-enable DOM UI bindings for data: URLs.
Re-enable TestDOMUIMessageCallback::NotificationTest

BUG=http://crbug.com/57680
TEST=TestDOMUIMessageCallback::NotificationTest
Review URL: http://codereview.chromium.org/3620006


git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61618 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/chromeos/notifications/notification_browsertest.cc b/chrome/browser/chromeos/notifications/notification_browsertest.cc
index 24fe8179..2d76a3d 100644
--- a/chrome/browser/chromeos/notifications/notification_browsertest.cc
+++ b/chrome/browser/chromeos/notifications/notification_browsertest.cc
@@ -588,10 +588,7 @@
           &NotificationTest::HandleDOMUIMessage)));
 }
 
-// TODO(oshima, caseq): FAILS after r61174 (see http://crbug.com/57580)
-// Either this needs to be rewritten not to use data: url, or data: URLs
-// should be allowed to execute DOM bindings.
-IN_PROC_BROWSER_TEST_F(NotificationTest, FAILS_TestDOMUIMessageCallback) {
+IN_PROC_BROWSER_TEST_F(NotificationTest, TestDOMUIMessageCallback) {
   BalloonCollectionImpl* collection = GetBalloonCollectionImpl();
   Profile* profile = browser()->profile();
   // a notification that sends 'test' domui message back to chrome.
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 8414ecc4..9c078661 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -3071,7 +3071,8 @@
     BindDOMAutomationController(frame);
   GURL frame_url = frame->url();
   if (BindingsPolicy::is_dom_ui_enabled(enabled_bindings_) &&
-      frame_url.SchemeIs(chrome::kChromeUIScheme)) {
+      (frame_url.SchemeIs(chrome::kChromeUIScheme) ||
+      frame_url.SchemeIs(chrome::kDataScheme))) {
     GetDOMUIBindings()->set_message_sender(this);
     GetDOMUIBindings()->set_routing_id(routing_id_);
     GetDOMUIBindings()->BindToJavascript(frame, L"chrome");