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

Unified Diff: chrome/browser/resources/file_manager/js/suggest_apps_dialog.js

Issue 23494024: [Files.app] Pass the access token to the widget by the 'initialize' message (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/file_manager/js/cws_container_client.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/suggest_apps_dialog.js
diff --git a/chrome/browser/resources/file_manager/js/suggest_apps_dialog.js b/chrome/browser/resources/file_manager/js/suggest_apps_dialog.js
index 3ddc2e32af32a679b98a8575b4bf12e5b4e77bb3..64a21607e7b488570c25483065e1f609e6d92a55 100644
--- a/chrome/browser/resources/file_manager/js/suggest_apps_dialog.js
+++ b/chrome/browser/resources/file_manager/js/suggest_apps_dialog.js
@@ -203,6 +203,8 @@ SuggestAppsDialog.prototype.onInputFocus = function() {
/**
* Injects headers into the passed request.
+ * TODO(yoshiki): Removes this method after the CWS widget supports the access
+ * token in 'initialization' message.
*
* @param {Event} e Request event.
* @return {{requestHeaders: HttpHeaders}} Modified headers.
@@ -277,6 +279,9 @@ SuggestAppsDialog.prototype.show = function(extension, mime, onDialogClosed) {
this.webviewContainer_.style.height = SPINNER_HEIGHT + 'px';
this.webview_ = this.container_.querySelector('#cws-widget');
+
+ // TODO(yoshiki): Removes the 'Authentication' header after the CWS widget
+ // supports the access token in 'initialization' message.
this.webview_.request.onBeforeSendHeaders.addListener(
this.authorizeRequest_.bind(this),
{urls: [this.widgetOrigin_ + '/*']},
@@ -288,7 +293,8 @@ SuggestAppsDialog.prototype.show = function(extension, mime, onDialogClosed) {
this.webview_,
extension, mime,
WEBVIEW_WIDTH, WEBVIEW_HEIGHT,
- this.widgetUrl_, this.widgetOrigin_);
+ this.widgetUrl_, this.widgetOrigin_,
+ this.accessToken_);
this.webviewClient_.addEventListener(CWSContainerClient.Events.LOADED,
this.onWidgetLoaded_.bind(this));
this.webviewClient_.addEventListener(CWSContainerClient.Events.LOAD_FAILED,
« no previous file with comments | « chrome/browser/resources/file_manager/js/cws_container_client.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698