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

Side by Side Diff: chrome/browser/printing/print_dialog_cloud.cc

Issue 7044070: Fix to allow print job submission in Linux (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser/printing/print_dialog_cloud.h" 5 #include "chrome/browser/printing/print_dialog_cloud.h"
6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h"
7 7
8 #include "base/base64.h" 8 #include "base/base64.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/json/json_reader.h" 11 #include "base/json/json_reader.h"
12 #include "base/utf_string_conversions.h"
12 #include "base/values.h" 13 #include "base/values.h"
13 #include "chrome/browser/debugger/devtools_manager.h" 14 #include "chrome/browser/debugger/devtools_manager.h"
14 #include "chrome/browser/prefs/pref_service.h" 15 #include "chrome/browser/prefs/pref_service.h"
15 #include "chrome/browser/printing/cloud_print/cloud_print_url.h" 16 #include "chrome/browser/printing/cloud_print/cloud_print_url.h"
16 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/profiles/profile_manager.h" 18 #include "chrome/browser/profiles/profile_manager.h"
18 #include "chrome/browser/ui/browser_dialogs.h" 19 #include "chrome/browser/ui/browser_dialogs.h"
19 #include "chrome/browser/ui/browser_list.h" 20 #include "chrome/browser/ui/browser_list.h"
20 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
21 #include "chrome/common/pref_names.h" 22 #include "chrome/common/pref_names.h"
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 command_line.GetSwitchValuePath(switches::kCloudPrintFile); 598 command_line.GetSwitchValuePath(switches::kCloudPrintFile);
598 if (!cloud_print_file.empty()) { 599 if (!cloud_print_file.empty()) {
599 string16 print_job_title; 600 string16 print_job_title;
600 if (command_line.HasSwitch(switches::kCloudPrintJobTitle)) { 601 if (command_line.HasSwitch(switches::kCloudPrintJobTitle)) {
601 #ifdef OS_WIN 602 #ifdef OS_WIN
602 CommandLine::StringType native_job_title; 603 CommandLine::StringType native_job_title;
603 native_job_title = command_line.GetSwitchValueNative( 604 native_job_title = command_line.GetSwitchValueNative(
604 switches::kCloudPrintJobTitle); 605 switches::kCloudPrintJobTitle);
605 print_job_title = string16(native_job_title); 606 print_job_title = string16(native_job_title);
606 #elif defined(OS_POSIX) 607 #elif defined(OS_POSIX)
607 // TODO(abodenha@chromium.org) Implement this for OS_POSIX 608 // POSIX Command line string types are different
sanjeevr 2011/06/09 16:23:50 Nit: Style guide needs a . at the end of the comme
608 // Command line string types are different 609 CommandLine::StringType native_job_title;
610 native_job_title = command_line.GetSwitchValueASCII(
611 switches::kCloudPrintJobTitle);
612 // Convert the ASCII string to UTF16 to prepare to pass
613 print_job_title = string16(ASCIIToUTF16(native_job_title));
609 #endif 614 #endif
610 } 615 }
611 std::string file_type = "application/pdf"; 616 std::string file_type = "application/pdf";
612 if (command_line.HasSwitch(switches::kCloudPrintFileType)) { 617 if (command_line.HasSwitch(switches::kCloudPrintFileType)) {
613 file_type = command_line.GetSwitchValueASCII( 618 file_type = command_line.GetSwitchValueASCII(
614 switches::kCloudPrintFileType); 619 switches::kCloudPrintFileType);
615 } 620 }
616 print_dialog_cloud::CreatePrintDialogForFile(cloud_print_file, 621 print_dialog_cloud::CreatePrintDialogForFile(cloud_print_file,
617 print_job_title, 622 print_job_title,
618 file_type, 623 file_type,
619 false); 624 false);
620 return true; 625 return true;
621 } 626 }
622 } 627 }
623 return false; 628 return false;
624 } 629 }
625 630
626 } // end namespace 631 } // end namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698