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

Side by Side Diff: chrome/renderer/render_view.cc

Issue 173166: Implement granular cross-origin XHR for extensions. (Closed)
Patch Set: some cleanup Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 dom_ui_bindings_.BindToJavascript(frame, L"chrome"); 1559 dom_ui_bindings_.BindToJavascript(frame, L"chrome");
1560 } 1560 }
1561 if (BindingsPolicy::is_external_host_enabled(enabled_bindings_)) { 1561 if (BindingsPolicy::is_external_host_enabled(enabled_bindings_)) {
1562 external_host_bindings_.set_message_sender(this); 1562 external_host_bindings_.set_message_sender(this);
1563 external_host_bindings_.set_routing_id(routing_id_); 1563 external_host_bindings_.set_routing_id(routing_id_);
1564 external_host_bindings_.BindToJavascript(frame, L"externalHost"); 1564 external_host_bindings_.BindToJavascript(frame, L"externalHost");
1565 } 1565 }
1566 } 1566 }
1567 1567
1568 void RenderView::DocumentElementAvailable(WebFrame* frame) { 1568 void RenderView::DocumentElementAvailable(WebFrame* frame) {
1569 // TODO(mpcomplete): remove this before Chrome extensions ship. 1569 // TODO(aa): Remove this before dev release.
1570 // HACK. This is a temporary workaround to allow cross-origin XHR for Chrome
1571 // extensions. It grants full access to every origin, when we really want
1572 // to be able to restrict them more specifically.
1573 GURL url = frame->url(); 1570 GURL url = frame->url();
1574 if (url.SchemeIs(chrome::kExtensionScheme)) 1571 if (url.SchemeIs(chrome::kExtensionScheme))
1575 frame->grantUniversalAccess(); 1572 frame->grantUniversalAccess();
1576 1573
1577 if (RenderThread::current()) // Will be NULL during unit tests. 1574 if (RenderThread::current()) // Will be NULL during unit tests.
1578 RenderThread::current()->user_script_slave()->InjectScripts( 1575 RenderThread::current()->user_script_slave()->InjectScripts(
1579 frame, UserScript::DOCUMENT_START); 1576 frame, UserScript::DOCUMENT_START);
1580 1577
1581 // Notify the browser about non-blank documents loading in the top frame. 1578 // Notify the browser about non-blank documents loading in the top frame.
1582 if (url.is_valid() && url.spec() != "about:blank") { 1579 if (url.is_valid() && url.spec() != "about:blank") {
(...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after
3322 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms)); 3319 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms));
3323 } 3320 }
3324 3321
3325 void RenderView::Print(WebFrame* frame, bool script_initiated) { 3322 void RenderView::Print(WebFrame* frame, bool script_initiated) {
3326 DCHECK(frame); 3323 DCHECK(frame);
3327 if (print_helper_.get() == NULL) { 3324 if (print_helper_.get() == NULL) {
3328 print_helper_.reset(new PrintWebViewHelper(this)); 3325 print_helper_.reset(new PrintWebViewHelper(this));
3329 } 3326 }
3330 print_helper_->Print(frame, script_initiated); 3327 print_helper_->Print(frame, script_initiated);
3331 } 3328 }
OLDNEW
« chrome/renderer/render_thread.h ('K') | « chrome/renderer/render_thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698