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

Side by Side Diff: extensions/browser/api/printer_provider/printer_provider_api.cc

Issue 979303002: Update UI for extension destinations in print preview destination list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "extensions/browser/api/printer_provider/printer_provider_api.h" 5 #include "extensions/browser/api/printer_provider/printer_provider_api.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 517
518 // Update some printer description properties to better identify the extension 518 // Update some printer description properties to better identify the extension
519 // managing the printer. 519 // managing the printer.
520 for (size_t i = 0; i < result.size(); ++i) { 520 for (size_t i = 0; i < result.size(); ++i) {
521 scoped_ptr<base::DictionaryValue> printer(result[i]->ToValue()); 521 scoped_ptr<base::DictionaryValue> printer(result[i]->ToValue());
522 std::string internal_printer_id; 522 std::string internal_printer_id;
523 CHECK(printer->GetString("id", &internal_printer_id)); 523 CHECK(printer->GetString("id", &internal_printer_id));
524 printer->SetString("id", 524 printer->SetString("id",
525 GeneratePrinterId(extension->id(), internal_printer_id)); 525 GeneratePrinterId(extension->id(), internal_printer_id));
526 printer->SetString("extensionId", extension->id()); 526 printer->SetString("extensionId", extension->id());
527 printer->SetString("extensionName", extension->name());
527 printer_list.Append(printer.release()); 528 printer_list.Append(printer.release());
528 } 529 }
529 530
530 pending_get_printers_requests_.CompleteForExtension(extension->id(), 531 pending_get_printers_requests_.CompleteForExtension(extension->id(),
531 request_id, printer_list); 532 request_id, printer_list);
532 } 533 }
533 534
534 void PrinterProviderAPIImpl::OnGetCapabilityResult( 535 void PrinterProviderAPIImpl::OnGetCapabilityResult(
535 const Extension* extension, 536 const Extension* extension,
536 int request_id, 537 int request_id,
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 return new PrinterProviderAPIImpl(context); 596 return new PrinterProviderAPIImpl(context);
596 } 597 }
597 598
598 // static 599 // static
599 std::string PrinterProviderAPI::GetDefaultPrintError() { 600 std::string PrinterProviderAPI::GetDefaultPrintError() {
600 return core_api::printer_provider_internal::ToString( 601 return core_api::printer_provider_internal::ToString(
601 core_api::printer_provider_internal::PRINT_ERROR_FAILED); 602 core_api::printer_provider_internal::PRINT_ERROR_FAILED);
602 } 603 }
603 604
604 } // namespace extensions 605 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698