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

Side by Side Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.h

Issue 2938073003: Change getAccessToken and getExtensionPrinterAccess to sendWithPromise (Closed)
Patch Set: Fix annotation Created 3 years, 6 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 void HandleGetPrivetPrinterCapabilities(const base::ListValue* arg); 216 void HandleGetPrivetPrinterCapabilities(const base::ListValue* arg);
217 217
218 // Requests an extension managed printer's capabilities. 218 // Requests an extension managed printer's capabilities.
219 // |arg| contains the ID of the printer whose capabilities are requested. 219 // |arg| contains the ID of the printer whose capabilities are requested.
220 void HandleGetExtensionPrinterCapabilities(const base::ListValue* args); 220 void HandleGetExtensionPrinterCapabilities(const base::ListValue* args);
221 221
222 void SendInitialSettings(const std::string& callback_id, 222 void SendInitialSettings(const std::string& callback_id,
223 const std::string& default_printer); 223 const std::string& default_printer);
224 224
225 // Send OAuth2 access token. 225 // Send OAuth2 access token.
226 void SendAccessToken(const std::string& type, 226 void SendAccessToken(const std::string& callback_id,
227 const std::string& access_token); 227 const std::string& access_token);
228 228
229 // Send message indicating a request for token was already in progress.
230 void SendRequestInProgress(const std::string& callback_id);
231
229 // Sends the printer capabilities to the Web UI. |settings_info| contains 232 // Sends the printer capabilities to the Web UI. |settings_info| contains
230 // printer capabilities information. If |settings_info| is empty, sends 233 // printer capabilities information. If |settings_info| is empty, sends
231 // error notification to the Web UI instead. 234 // error notification to the Web UI instead.
232 void SendPrinterCapabilities( 235 void SendPrinterCapabilities(
233 const std::string& callback_id, 236 const std::string& callback_id,
234 const std::string& printer_name, 237 const std::string& printer_name,
235 std::unique_ptr<base::DictionaryValue> settings_info); 238 std::unique_ptr<base::DictionaryValue> settings_info);
236 239
237 // Send the result of performing printer setup. |settings_info| contains 240 // Send the result of performing printer setup. |settings_info| contains
238 // printer capabilities. 241 // printer capabilities.
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 // are loaded (when |done| = true) 330 // are loaded (when |done| = true)
328 // |printers|: The list of printers managed by the extension. 331 // |printers|: The list of printers managed by the extension.
329 // |done|: Whether all the extensions have reported the list of printers 332 // |done|: Whether all the extensions have reported the list of printers
330 // they manage. 333 // they manage.
331 void OnGotPrintersForExtension(const std::string& callback_id, 334 void OnGotPrintersForExtension(const std::string& callback_id,
332 const base::ListValue& printers, 335 const base::ListValue& printers,
333 bool done); 336 bool done);
334 337
335 // Called when an extension reports information requested for a provisional 338 // Called when an extension reports information requested for a provisional
336 // printer. 339 // printer.
337 // |printer_id|: The provisional printer id. 340 // |callback_id|: The javascript callback to resolve or reject.
338 // |printer_info|: The data reported by the extension. 341 // |printer_info|: The data reported by the extension.
339 void OnGotExtensionPrinterInfo(const std::string& printer_id, 342 void OnGotExtensionPrinterInfo(const std::string& callback_id,
340 const base::DictionaryValue& printer_info); 343 const base::DictionaryValue& printer_info);
341 344
342 // Called when an extension reports the set of print capabilites for a 345 // Called when an extension reports the set of print capabilites for a
343 // printer. 346 // printer.
344 // |callback_id|: The Javascript callback to reject or resolve 347 // |callback_id|: The Javascript callback to reject or resolve
345 // |capabilities|: The printer capabilities. 348 // |capabilities|: The printer capabilities.
346 void OnGotExtensionPrinterCapabilities( 349 void OnGotExtensionPrinterCapabilities(
347 const std::string& callback_id, 350 const std::string& callback_id,
348 const base::DictionaryValue& capabilities); 351 const base::DictionaryValue& capabilities);
349 352
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 // Proxy for calls to the print backend. Lazily initialized since web_ui() is 415 // Proxy for calls to the print backend. Lazily initialized since web_ui() is
413 // not available at construction time. 416 // not available at construction time.
414 std::unique_ptr<printing::PrinterBackendProxy> printer_backend_proxy_; 417 std::unique_ptr<printing::PrinterBackendProxy> printer_backend_proxy_;
415 418
416 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_; 419 base::WeakPtrFactory<PrintPreviewHandler> weak_factory_;
417 420
418 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); 421 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler);
419 }; 422 };
420 423
421 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_ 424 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_HANDLER_H_
OLDNEW
« 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