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

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

Issue 22185002: Add browser test to the sharing dialog feature in Files.app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed jsdoc. Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/file_manager/js/share_dialog.js
diff --git a/chrome/browser/resources/file_manager/js/share_dialog.js b/chrome/browser/resources/file_manager/js/share_dialog.js
index 15ba6c8c80f16178662d8a81878982540def4e48..6cbf3d341f6bb4f5231714f0666c2f3f075d18a4 100644
--- a/chrome/browser/resources/file_manager/js/share_dialog.js
+++ b/chrome/browser/resources/file_manager/js/share_dialog.js
@@ -56,9 +56,11 @@ ShareDialog.WebViewAuthorizer.prototype.initialize = function(callback) {
var registerInjectionHooks = function() {
this.webView_.removeEventListener('loadstop', registerInjectionHooks);
+ var pattern = (this.origin_ == '<all_urls>') ? this.origin_ :
+ this.origin_ + '/*';
this.webView_.onBeforeSendHeaders.addListener(
this.authorizeRequest_.bind(this),
- {urls: [this.origin_ + '/*']},
+ {urls: [pattern]},
['blocking', 'requestHeaders']);
this.initialized_ = true;
callback();
@@ -218,14 +220,14 @@ ShareDialog.prototype.show = function(entry, onFailure) {
this.webViewWrapper_, 'share-dialog-webview', 'webview');
this.webView_.setAttribute('tabIndex', '-1');
this.webViewAuthorizer_ = new ShareDialog.WebViewAuthorizer(
- ShareClient.SHARE_TARGET, this.webView_);
+ !window.IN_TEST ? ShareClient.SHARE_TARGET : '<all_urls>',
yoshiki 2013/08/06 01:17:01 ShareClient.SHARE_TARGET is an origin, but "<all_u
mtomasz 2013/08/06 02:02:35 Good idea! Done.
+ this.webView_);
this.webView_.addEventListener('newwindow', function(e) {
// Discard the window object and reopen in an external window.
e.window.discard();
chrome.windows.create({url: e.targetUrl});
e.preventDefault();
});
-
cr.ui.dialogs.BaseDialog.prototype.show.call(this, '', null, null, null);
// Initialize and authorize the Web View tag asynchronously.

Powered by Google App Engine
This is Rietveld 408576698