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

Unified Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.h

Issue 14093016: Native api to get OAuth2 access tokens in Print Preview Web UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/ui/webui/print_preview/print_preview_handler.h
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.h b/chrome/browser/ui/webui/print_preview/print_preview_handler.h
index 71658a7a1e677d5602b06a821280df3534daa9c9..788d99a0fe25fa4f4e70486753a55e7db494a495 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.h
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.h
@@ -115,6 +115,9 @@ class PrintPreviewHandler : public content::WebUIMessageHandler,
// |args| is unused.
void HandleSignin(const base::ListValue* args);
+ // Generates new token and sends back to UI.
+ void HandleGetAccessToken(const base::ListValue* args);
+
// Brings up a web page to allow the user to configure cloud print.
// |args| is unused.
void HandleManageCloudPrint(const base::ListValue* args);
@@ -151,6 +154,10 @@ class PrintPreviewHandler : public content::WebUIMessageHandler,
const std::string& default_printer,
const std::string& cloud_print_data);
+ // Send OAuth2 access token.
+ void SendAccessToken(const std::string& type,
+ const std::string& access_token);
+
// Sends the printer capabilities to the Web UI. |settings_info| contains
// printer capabilities information.
void SendPrinterCapabilities(const base::DictionaryValue& settings_info);
@@ -198,6 +205,8 @@ class PrintPreviewHandler : public content::WebUIMessageHandler,
bool GetPreviewDataAndTitle(scoped_refptr<base::RefCountedBytes>* data,
string16* title) const;
+ void InitTokenService();
+
// Pointer to current print system.
scoped_refptr<printing::PrintBackend> print_backend_;
@@ -222,6 +231,10 @@ class PrintPreviewHandler : public content::WebUIMessageHandler,
// exists.
scoped_ptr<base::FilePath> print_to_pdf_path_;
+ // Holds token service to get OAuth2 access tokens.
+ class AccessTokenService;
+ scoped_ptr<AccessTokenService> token_service_;
+
DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler);
};
« no previous file with comments | « chrome/browser/resources/print_preview/native_layer.js ('k') | chrome/browser/ui/webui/print_preview/print_preview_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698