Use device Robot Account to access Cloud Print.

- Search requests uses both: current cookies and OAuth2 token for device Robot Account.
- User cookies or OAuth2 used in search for operation with a printer (print, get capabilities etc.)
- Put printer accessible for Robot Account to local destination.

BUG=179229
NOTRY=True

Review URL: https://chromiumcodereview.appspot.com/14370003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195371 0039d316-1c4b-4281-b951-d872f2087c98
parent f77f856d
......@@ -308,6 +308,7 @@ cr.define('print_preview', function() {
'not enabled');
destination.isTosAccepted = true;
this.cloudPrintInterface_.updatePrinterTosAcceptance(destination.id,
destination.origin,
true);
}
this.appState_.persistSelectedDestination(this.selectedDestination_);
......
......@@ -72,8 +72,10 @@ cr.define('print_preview', function() {
* @private
*/
onCloudPrintSearchDone_: function(event) {
this.userEmail_ = event.email;
cr.dispatchSimpleEvent(this, UserInfo.EventType.EMAIL_CHANGE);
if (event.origin == print_preview.Destination.Origin.COOKIES) {
this.userEmail_ = event.email;
cr.dispatchSimpleEvent(this, UserInfo.EventType.EMAIL_CHANGE);
}
}
};
......
......@@ -496,7 +496,8 @@ cr.define('print_preview', function() {
*/
onCloudPrintEnable_: function(event) {
this.cloudPrintInterface_ =
new cloudprint.CloudPrintInterface(event.baseCloudPrintUrl);
new cloudprint.CloudPrintInterface(event.baseCloudPrintUrl,
this.nativeLayer_);
this.tracker.add(
this.cloudPrintInterface_,
cloudprint.CloudPrintInterface.EventType.SUBMIT_DONE,
......
......@@ -284,7 +284,8 @@ cr.define('print_preview', function() {
if (destination.isRecent) {
recentDestinations.push(destination);
}
if (destination.isLocal) {
if (destination.isLocal ||
destination.origin == print_preview.Destination.Origin.DEVICE) {
localDestinations.push(destination);
} else {
cloudDestinations.push(destination);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment