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

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

Issue 23498004: Remove page cyclers from chrome binary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
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/browser/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 #include "chrome/browser/metrics/metrics_service.h" 68 #include "chrome/browser/metrics/metrics_service.h"
69 #include "chrome/browser/metrics/thread_watcher.h" 69 #include "chrome/browser/metrics/thread_watcher.h"
70 #include "chrome/browser/metrics/tracking_synchronizer.h" 70 #include "chrome/browser/metrics/tracking_synchronizer.h"
71 #include "chrome/browser/metrics/variations/variations_service.h" 71 #include "chrome/browser/metrics/variations/variations_service.h"
72 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" 72 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h"
73 #include "chrome/browser/nacl_host/nacl_process_host.h" 73 #include "chrome/browser/nacl_host/nacl_process_host.h"
74 #include "chrome/browser/net/chrome_net_log.h" 74 #include "chrome/browser/net/chrome_net_log.h"
75 #include "chrome/browser/net/crl_set_fetcher.h" 75 #include "chrome/browser/net/crl_set_fetcher.h"
76 #include "chrome/browser/notifications/desktop_notification_service.h" 76 #include "chrome/browser/notifications/desktop_notification_service.h"
77 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 77 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
78 #include "chrome/browser/page_cycler/page_cycler.h"
79 #include "chrome/browser/performance_monitor/performance_monitor.h" 78 #include "chrome/browser/performance_monitor/performance_monitor.h"
80 #include "chrome/browser/performance_monitor/startup_timer.h" 79 #include "chrome/browser/performance_monitor/startup_timer.h"
81 #include "chrome/browser/plugins/plugin_prefs.h" 80 #include "chrome/browser/plugins/plugin_prefs.h"
82 #include "chrome/browser/pref_service_flags_storage.h" 81 #include "chrome/browser/pref_service_flags_storage.h"
83 #include "chrome/browser/prefs/chrome_pref_service_factory.h" 82 #include "chrome/browser/prefs/chrome_pref_service_factory.h"
84 #include "chrome/browser/prefs/command_line_pref_store.h" 83 #include "chrome/browser/prefs/command_line_pref_store.h"
85 #include "chrome/browser/prefs/pref_metrics_service.h" 84 #include "chrome/browser/prefs/pref_metrics_service.h"
86 #include "chrome/browser/prefs/scoped_user_pref_update.h" 85 #include "chrome/browser/prefs/scoped_user_pref_update.h"
87 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" 86 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
88 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" 87 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h"
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 void ChromeBrowserMainParts::PreBrowserStart() { 1078 void ChromeBrowserMainParts::PreBrowserStart() {
1080 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreBrowserStart"); 1079 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreBrowserStart");
1081 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) 1080 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
1082 chrome_extra_parts_[i]->PreBrowserStart(); 1081 chrome_extra_parts_[i]->PreBrowserStart();
1083 1082
1084 three_d_observer_.reset(new ThreeDAPIObserver()); 1083 three_d_observer_.reset(new ThreeDAPIObserver());
1085 } 1084 }
1086 1085
1087 void ChromeBrowserMainParts::PostBrowserStart() { 1086 void ChromeBrowserMainParts::PostBrowserStart() {
1088 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostBrowserStart"); 1087 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PostBrowserStart");
1089 #if !defined(OS_ANDROID)
1090 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kVisitURLs))
1091 RunPageCycler();
1092 #endif
1093
1094 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) 1088 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
1095 chrome_extra_parts_[i]->PostBrowserStart(); 1089 chrome_extra_parts_[i]->PostBrowserStart();
1096 #if !defined(OS_ANDROID) 1090 #if !defined(OS_ANDROID)
1097 // Allow ProcessSingleton to process messages. 1091 // Allow ProcessSingleton to process messages.
1098 process_singleton_->Unlock(); 1092 process_singleton_->Unlock();
1099 #endif 1093 #endif
1100 } 1094 }
1101 1095
1102 #if !defined(OS_ANDROID)
1103 void ChromeBrowserMainParts::RunPageCycler() {
1104 CommandLine* command_line = CommandLine::ForCurrentProcess();
1105 Browser* browser = chrome::FindBrowserWithProfile(profile_,
1106 chrome::GetActiveDesktop());
1107 DCHECK(browser);
1108 PageCycler* page_cycler = NULL;
1109 base::FilePath input_file =
1110 command_line->GetSwitchValuePath(switches::kVisitURLs);
1111 page_cycler = new PageCycler(browser, input_file);
1112 page_cycler->set_errors_file(
1113 input_file.AddExtension(FILE_PATH_LITERAL(".errors")));
1114 if (command_line->HasSwitch(switches::kRecordStats)) {
1115 page_cycler->set_stats_file(
1116 command_line->GetSwitchValuePath(switches::kRecordStats));
1117 }
1118 page_cycler->Run();
1119 }
1120 #endif // !defined(OS_ANDROID)
1121
1122 void ChromeBrowserMainParts::SetupPlatformFieldTrials() { 1096 void ChromeBrowserMainParts::SetupPlatformFieldTrials() {
1123 // Base class implementation of this does nothing. 1097 // Base class implementation of this does nothing.
1124 } 1098 }
1125 1099
1126 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { 1100 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
1127 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl"); 1101 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl");
1128 #if !defined(OS_ANDROID) 1102 #if !defined(OS_ANDROID)
1129 if (CommandLine::ForCurrentProcess()->HasSwitch( 1103 if (CommandLine::ForCurrentProcess()->HasSwitch(
1130 switches::kTrackActiveVisitTime)) { 1104 switches::kTrackActiveVisitTime)) {
1131 active_tab_tracker_.reset(new ActiveTabTracker()); 1105 active_tab_tracker_.reset(new ActiveTabTracker());
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 chromeos::CrosSettings::Shutdown(); 1674 chromeos::CrosSettings::Shutdown();
1701 #endif 1675 #endif
1702 #endif 1676 #endif
1703 } 1677 }
1704 1678
1705 // Public members: 1679 // Public members:
1706 1680
1707 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1681 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1708 chrome_extra_parts_.push_back(parts); 1682 chrome_extra_parts_.push_back(parts);
1709 } 1683 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698