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

Side by Side Diff: chrome/browser/browser_main.cc

Issue 6038008: Modify chrome to accept a pdf file on the command line and upload it to Cloud... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | chrome/browser/printing/print_dialog_cloud.h » ('j') | 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/browser_main.h" 5 #include "chrome/browser/browser_main.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ui/base/l10n/l10n_util.h"
12 #include "base/at_exit.h" 11 #include "base/at_exit.h"
13 #include "base/command_line.h" 12 #include "base/command_line.h"
14 #include "base/debug/trace_event.h" 13 #include "base/debug/trace_event.h"
15 #include "base/file_path.h" 14 #include "base/file_path.h"
16 #include "base/file_util.h" 15 #include "base/file_util.h"
17 #include "base/mac/scoped_nsautorelease_pool.h" 16 #include "base/mac/scoped_nsautorelease_pool.h"
18 #include "base/metrics/field_trial.h" 17 #include "base/metrics/field_trial.h"
19 #include "base/metrics/histogram.h" 18 #include "base/metrics/histogram.h"
20 #include "base/path_service.h" 19 #include "base/path_service.h"
21 #include "base/process_util.h" 20 #include "base/process_util.h"
(...skipping 28 matching lines...) Expand all
50 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" 49 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h"
51 #include "chrome/browser/net/metadata_url_request.h" 50 #include "chrome/browser/net/metadata_url_request.h"
52 #include "chrome/browser/net/predictor_api.h" 51 #include "chrome/browser/net/predictor_api.h"
53 #include "chrome/browser/net/sdch_dictionary_fetcher.h" 52 #include "chrome/browser/net/sdch_dictionary_fetcher.h"
54 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" 53 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h"
55 #include "chrome/browser/plugin_service.h" 54 #include "chrome/browser/plugin_service.h"
56 #include "chrome/browser/prefs/browser_prefs.h" 55 #include "chrome/browser/prefs/browser_prefs.h"
57 #include "chrome/browser/prefs/pref_service.h" 56 #include "chrome/browser/prefs/pref_service.h"
58 #include "chrome/browser/prefs/pref_value_store.h" 57 #include "chrome/browser/prefs/pref_value_store.h"
59 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" 58 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
59 #include "chrome/browser/printing/print_dialog_cloud.h"
60 #include "chrome/browser/process_singleton.h" 60 #include "chrome/browser/process_singleton.h"
61 #include "chrome/browser/profiles/profile.h" 61 #include "chrome/browser/profiles/profile.h"
62 #include "chrome/browser/profiles/profile_manager.h" 62 #include "chrome/browser/profiles/profile_manager.h"
63 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" 63 #include "chrome/browser/renderer_host/resource_dispatcher_host.h"
64 #include "chrome/browser/search_engines/search_engine_type.h" 64 #include "chrome/browser/search_engines/search_engine_type.h"
65 #include "chrome/browser/search_engines/template_url.h" 65 #include "chrome/browser/search_engines/template_url.h"
66 #include "chrome/browser/search_engines/template_url_model.h" 66 #include "chrome/browser/search_engines/template_url_model.h"
67 #include "chrome/browser/service/service_process_control.h" 67 #include "chrome/browser/service/service_process_control.h"
68 #include "chrome/browser/service/service_process_control_manager.h" 68 #include "chrome/browser/service/service_process_control_manager.h"
69 #include "chrome/browser/shell_integration.h" 69 #include "chrome/browser/shell_integration.h"
(...skipping 24 matching lines...) Expand all
94 #include "net/base/network_change_notifier.h" 94 #include "net/base/network_change_notifier.h"
95 #include "net/http/http_network_layer.h" 95 #include "net/http/http_network_layer.h"
96 #include "net/http/http_stream_factory.h" 96 #include "net/http/http_stream_factory.h"
97 #include "net/socket/client_socket_pool_base.h" 97 #include "net/socket/client_socket_pool_base.h"
98 #include "net/socket/client_socket_pool_manager.h" 98 #include "net/socket/client_socket_pool_manager.h"
99 #include "net/socket/tcp_client_socket.h" 99 #include "net/socket/tcp_client_socket.h"
100 #include "net/spdy/spdy_session.h" 100 #include "net/spdy/spdy_session.h"
101 #include "net/spdy/spdy_session_pool.h" 101 #include "net/spdy/spdy_session_pool.h"
102 #include "net/url_request/url_request.h" 102 #include "net/url_request/url_request.h"
103 #include "net/url_request/url_request_throttler_manager.h" 103 #include "net/url_request/url_request_throttler_manager.h"
104 #include "ui/base/l10n/l10n_util.h"
104 #include "ui/base/resource/resource_bundle.h" 105 #include "ui/base/resource/resource_bundle.h"
105 #include "ui/base/system_monitor/system_monitor.h" 106 #include "ui/base/system_monitor/system_monitor.h"
106 107
107 #if defined(USE_LINUX_BREAKPAD) 108 #if defined(USE_LINUX_BREAKPAD)
108 #include "base/linux_util.h" 109 #include "base/linux_util.h"
109 #include "chrome/app/breakpad_linux.h" 110 #include "chrome/app/breakpad_linux.h"
110 #endif 111 #endif
111 112
112 #if defined(OS_POSIX) && !defined(OS_MACOSX) 113 #if defined(OS_POSIX) && !defined(OS_MACOSX)
113 #include <dbus/dbus-glib.h> 114 #include <dbus/dbus-glib.h>
(...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 // TODO(hclam): Need to check for cloud print proxy too. 1631 // TODO(hclam): Need to check for cloud print proxy too.
1631 if (parsed_command_line.HasSwitch(switches::kEnableRemoting)) { 1632 if (parsed_command_line.HasSwitch(switches::kEnableRemoting)) {
1632 if (user_prefs->GetBoolean(prefs::kRemotingHasSetupCompleted)) { 1633 if (user_prefs->GetBoolean(prefs::kRemotingHasSetupCompleted)) {
1633 ServiceProcessControl* control = 1634 ServiceProcessControl* control =
1634 ServiceProcessControlManager::GetInstance()->GetProcessControl( 1635 ServiceProcessControlManager::GetInstance()->GetProcessControl(
1635 profile); 1636 profile);
1636 control->Launch(NULL, NULL); 1637 control->Launch(NULL, NULL);
1637 } 1638 }
1638 } 1639 }
1639 1640
1641 if (parsed_command_line.HasSwitch(switches::kCloudPrintFile)) {
1642 FilePath cloud_print_file;
1643 cloud_print_file =
1644 parsed_command_line.GetSwitchValuePath(switches::kCloudPrintFile);
1645 if (!cloud_print_file.empty()) {
1646 string16 print_job_title;
1647 if (parsed_command_line.HasSwitch(switches::kCloudPrintJobTitle)) {
1648 #ifdef OS_WIN
1649 CommandLine::StringType native_job_title;
1650 native_job_title = CommandLine::ForCurrentProcess()->GetSwitchValueNative(
1651 switches::kCloudPrintJobTitle);
1652 print_job_title = string16(native_job_title);
1653 #elif defined(OS_POSIX)
1654 // TODO(abodenha@google.com) Implement this for OS_POSIX
1655 // Command line string types are different
1656 #endif
1657 }
1658 PrintDialogCloud::CreatePrintDialogForPdf(cloud_print_file,
1659 print_job_title,
1660 false);
1661 }
1662 }
1663
1640 #if defined(OS_CHROMEOS) 1664 #if defined(OS_CHROMEOS)
1641 // Run the Out of Memory priority manager while in this scope. Wait 1665 // Run the Out of Memory priority manager while in this scope. Wait
1642 // until here to start so that we give the most amount of time for 1666 // until here to start so that we give the most amount of time for
1643 // the other services to start up before we start adjusting the oom 1667 // the other services to start up before we start adjusting the oom
1644 // priority. In reality, it doesn't matter much where in this scope 1668 // priority. In reality, it doesn't matter much where in this scope
1645 // this is started, but it must be started in this scope so it will 1669 // this is started, but it must be started in this scope so it will
1646 // also be terminated when this scope exits. 1670 // also be terminated when this scope exits.
1647 scoped_ptr<browser::OomPriorityManager> oom_priority_manager( 1671 scoped_ptr<browser::OomPriorityManager> oom_priority_manager(
1648 new browser::OomPriorityManager); 1672 new browser::OomPriorityManager);
1649 #endif 1673 #endif
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
1749 #if defined(OS_CHROMEOS) 1773 #if defined(OS_CHROMEOS)
1750 // To be precise, logout (browser shutdown) is not yet done, but the 1774 // To be precise, logout (browser shutdown) is not yet done, but the
1751 // remaining work is negligible, hence we say LogoutDone here. 1775 // remaining work is negligible, hence we say LogoutDone here.
1752 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", 1776 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone",
1753 false); 1777 false);
1754 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); 1778 chromeos::BootTimesLoader::Get()->WriteLogoutTimes();
1755 #endif 1779 #endif
1756 TRACE_EVENT_END("BrowserMain", 0, 0); 1780 TRACE_EVENT_END("BrowserMain", 0, 0);
1757 return result_code; 1781 return result_code;
1758 } 1782 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/printing/print_dialog_cloud.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698