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

Side by Side Diff: chrome/utility/chrome_content_utility_client.cc

Issue 22577010: Printing: Add a basic printing mode without print preview and cloud print. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 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 #include "chrome/utility/chrome_content_utility_client.h" 5 #include "chrome/utility/chrome_content_utility_client.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "printing/emf_win.h" 46 #include "printing/emf_win.h"
47 #include "ui/gfx/gdi_util.h" 47 #include "ui/gfx/gdi_util.h"
48 #endif // defined(OS_WIN) 48 #endif // defined(OS_WIN)
49 49
50 #if defined(OS_WIN) || defined(OS_MACOSX) 50 #if defined(OS_WIN) || defined(OS_MACOSX)
51 #include "chrome/utility/media_galleries/itunes_library_parser.h" 51 #include "chrome/utility/media_galleries/itunes_library_parser.h"
52 #include "chrome/utility/media_galleries/picasa_album_table_reader.h" 52 #include "chrome/utility/media_galleries/picasa_album_table_reader.h"
53 #include "chrome/utility/media_galleries/picasa_albums_indexer.h" 53 #include "chrome/utility/media_galleries/picasa_albums_indexer.h"
54 #endif // defined(OS_WIN) || defined(OS_MACOSX) 54 #endif // defined(OS_WIN) || defined(OS_MACOSX)
55 55
56 #if defined(ENABLE_PRINTING) 56 #if defined(ENABLE_FULL_PRINTING)
57 #include "chrome/common/child_process_logging.h" 57 #include "chrome/common/child_process_logging.h"
58 #include "printing/backend/print_backend.h" 58 #include "printing/backend/print_backend.h"
59 #endif 59 #endif
60 60
61 #if defined(ENABLE_MDNS) 61 #if defined(ENABLE_MDNS)
62 #include "chrome/utility/local_discovery/service_discovery_message_handler.h" 62 #include "chrome/utility/local_discovery/service_discovery_message_handler.h"
63 #endif // ENABLE_MDNS 63 #endif // ENABLE_MDNS
64 64
65 namespace chrome { 65 namespace chrome {
66 66
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 wrapper.Append(value); 487 wrapper.Append(value);
488 Send(new ChromeUtilityHostMsg_ParseJSON_Succeeded(wrapper)); 488 Send(new ChromeUtilityHostMsg_ParseJSON_Succeeded(wrapper));
489 } else { 489 } else {
490 Send(new ChromeUtilityHostMsg_ParseJSON_Failed(error)); 490 Send(new ChromeUtilityHostMsg_ParseJSON_Failed(error));
491 } 491 }
492 ReleaseProcessIfNeeded(); 492 ReleaseProcessIfNeeded();
493 } 493 }
494 494
495 void ChromeContentUtilityClient::OnGetPrinterCapsAndDefaults( 495 void ChromeContentUtilityClient::OnGetPrinterCapsAndDefaults(
496 const std::string& printer_name) { 496 const std::string& printer_name) {
497 #if defined(ENABLE_PRINTING) 497 #if defined(ENABLE_FULL_PRINTING)
498 scoped_refptr<printing::PrintBackend> print_backend = 498 scoped_refptr<printing::PrintBackend> print_backend =
499 printing::PrintBackend::CreateInstance(NULL); 499 printing::PrintBackend::CreateInstance(NULL);
500 printing::PrinterCapsAndDefaults printer_info; 500 printing::PrinterCapsAndDefaults printer_info;
501 501
502 child_process_logging::ScopedPrinterInfoSetter prn_info( 502 child_process_logging::ScopedPrinterInfoSetter prn_info(
503 print_backend->GetPrinterDriverInfo(printer_name)); 503 print_backend->GetPrinterDriverInfo(printer_name));
504 504
505 if (print_backend->GetPrinterCapsAndDefaults(printer_name, &printer_info)) { 505 if (print_backend->GetPrinterCapsAndDefaults(printer_name, &printer_info)) {
506 Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded( 506 Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded(
507 printer_name, printer_info)); 507 printer_name, printer_info));
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 indexer.ParseFolderINI(it->folder_path, it->ini_contents); 601 indexer.ParseFolderINI(it->folder_path, it->ini_contents);
602 } 602 }
603 603
604 Send(new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished( 604 Send(new ChromeUtilityHostMsg_IndexPicasaAlbumsContents_Finished(
605 indexer.albums_images())); 605 indexer.albums_images()));
606 ReleaseProcessIfNeeded(); 606 ReleaseProcessIfNeeded();
607 } 607 }
608 #endif // defined(OS_WIN) || defined(OS_MACOSX) 608 #endif // defined(OS_WIN) || defined(OS_MACOSX)
609 609
610 } // namespace chrome 610 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/test/base/web_ui_browsertest.cc ('k') | content/browser/renderer_host/pepper/pepper_print_settings_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698