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

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

Issue 9699054: rlz: Hook up on mac, switch to chrome's network stack on win. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 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 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 #if defined(OS_WIN) 144 #if defined(OS_WIN)
145 #include "base/environment.h" // For PreRead experiment. 145 #include "base/environment.h" // For PreRead experiment.
146 #include "base/win/windows_version.h" 146 #include "base/win/windows_version.h"
147 #include "chrome/browser/browser_trial.h" 147 #include "chrome/browser/browser_trial.h"
148 #include "chrome/browser/browser_util_win.h" 148 #include "chrome/browser/browser_util_win.h"
149 #include "chrome/browser/chrome_browser_main_win.h" 149 #include "chrome/browser/chrome_browser_main_win.h"
150 #include "chrome/browser/first_run/try_chrome_dialog_view.h" 150 #include "chrome/browser/first_run/try_chrome_dialog_view.h"
151 #include "chrome/browser/first_run/upgrade_util_win.h" 151 #include "chrome/browser/first_run/upgrade_util_win.h"
152 #include "chrome/browser/net/url_fixer_upper.h" 152 #include "chrome/browser/net/url_fixer_upper.h"
153 #include "chrome/browser/rlz/rlz.h"
154 #include "chrome/browser/ui/views/user_data_dir_dialog.h" 153 #include "chrome/browser/ui/views/user_data_dir_dialog.h"
155 #include "chrome/installer/util/helper.h" 154 #include "chrome/installer/util/helper.h"
156 #include "chrome/installer/util/install_util.h" 155 #include "chrome/installer/util/install_util.h"
157 #include "chrome/installer/util/shell_util.h" 156 #include "chrome/installer/util/shell_util.h"
158 #include "net/base/net_util.h" 157 #include "net/base/net_util.h"
159 #include "printing/printed_document.h" 158 #include "printing/printed_document.h"
160 #include "ui/base/l10n/l10n_util_win.h" 159 #include "ui/base/l10n/l10n_util_win.h"
161 #endif // defined(OS_WIN) 160 #endif // defined(OS_WIN)
162 161
163 #if defined(OS_MACOSX) 162 #if defined(OS_MACOSX)
164 #include <Security/Security.h> 163 #include <Security/Security.h>
165 164
166 #include "base/mac/scoped_nsautorelease_pool.h" 165 #include "base/mac/scoped_nsautorelease_pool.h"
167 #include "chrome/browser/mac/install_from_dmg.h" 166 #include "chrome/browser/mac/install_from_dmg.h"
168 #include "chrome/browser/mac/keystone_glue.h" 167 #include "chrome/browser/mac/keystone_glue.h"
169 #endif 168 #endif
170 169
170 #if defined(ENABLE_RLZ)
171 #include "chrome/browser/rlz/rlz.h"
172 #endif
173
171 #if defined(TOOLKIT_VIEWS) 174 #if defined(TOOLKIT_VIEWS)
172 #include "ui/views/focus/accelerator_handler.h" 175 #include "ui/views/focus/accelerator_handler.h"
173 #endif 176 #endif
174 177
175 #if defined(TOOLKIT_USES_GTK) 178 #if defined(TOOLKIT_USES_GTK)
176 #include "chrome/browser/ui/gtk/gtk_util.h" 179 #include "chrome/browser/ui/gtk/gtk_util.h"
177 #include "ui/gfx/gtk_util.h" 180 #include "ui/gfx/gtk_util.h"
178 #endif 181 #endif
179 182
180 #if defined(USE_X11) 183 #if defined(USE_X11)
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 1605
1603 // Registers Chrome with the Windows Restart Manager, which will restore the 1606 // Registers Chrome with the Windows Restart Manager, which will restore the
1604 // Chrome session when the computer is restarted after a system update. 1607 // Chrome session when the computer is restarted after a system update.
1605 // This could be run as late as WM_QUERYENDSESSION for system update reboots, 1608 // This could be run as late as WM_QUERYENDSESSION for system update reboots,
1606 // but should run on startup if extended to handle crashes/hangs/patches. 1609 // but should run on startup if extended to handle crashes/hangs/patches.
1607 // Also, better to run once here than once for each HWND's WM_QUERYENDSESSION. 1610 // Also, better to run once here than once for each HWND's WM_QUERYENDSESSION.
1608 if (base::win::GetVersion() >= base::win::VERSION_VISTA) { 1611 if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
1609 ChromeBrowserMainPartsWin::RegisterApplicationRestart( 1612 ChromeBrowserMainPartsWin::RegisterApplicationRestart(
1610 parsed_command_line()); 1613 parsed_command_line());
1611 } 1614 }
1615 #endif // OS_WIN
1612 1616
1613 #if defined(GOOGLE_CHROME_BUILD) 1617 #if defined(ENABLE_RLZ)
1614 // Init the RLZ library. This just binds the dll and schedules a task on the 1618 // Init the RLZ library. This just binds the dll and schedules a task on the
1615 // file thread to be run sometime later. If this is the first run we record 1619 // file thread to be run sometime later. If this is the first run we record
1616 // the installation event. 1620 // the installation event.
1617 bool google_search_default = false; 1621 bool google_search_default = false;
1618 TemplateURLService* template_url_service = 1622 TemplateURLService* template_url_service =
1619 TemplateURLServiceFactory::GetForProfile(profile_); 1623 TemplateURLServiceFactory::GetForProfile(profile_);
1620 if (template_url_service) { 1624 if (template_url_service) {
1621 const TemplateURL* url_template = 1625 const TemplateURL* url_template =
1622 template_url_service->GetDefaultSearchProvider(); 1626 template_url_service->GetDefaultSearchProvider();
1623 if (url_template) { 1627 if (url_template) {
(...skipping 11 matching lines...) Expand all
1635 google_search_homepage = google_util::IsGoogleHomePageUrl(homepage); 1639 google_search_homepage = google_util::IsGoogleHomePageUrl(homepage);
1636 } 1640 }
1637 1641
1638 RLZTracker::InitRlzDelayed(is_first_run_, master_prefs_->ping_delay, 1642 RLZTracker::InitRlzDelayed(is_first_run_, master_prefs_->ping_delay,
1639 google_search_default, google_search_homepage); 1643 google_search_default, google_search_homepage);
1640 1644
1641 // Prime the RLZ cache for the home page access point so that its avaiable 1645 // Prime the RLZ cache for the home page access point so that its avaiable
1642 // for the startup page if needed (i.e., when the startup page is set to 1646 // for the startup page if needed (i.e., when the startup page is set to
1643 // the home page). 1647 // the home page).
1644 RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_HOME_PAGE, NULL); 1648 RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_HOME_PAGE, NULL);
1645 #endif // GOOGLE_CHROME_BUILD 1649 #endif // defined(ENABLE_RLZ)
1646 #endif // OS_WIN
1647 1650
1648 // Configure modules that need access to resources. 1651 // Configure modules that need access to resources.
1649 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); 1652 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider);
1650 1653
1651 // In unittest mode, this will do nothing. In normal mode, this will create 1654 // In unittest mode, this will do nothing. In normal mode, this will create
1652 // the global GoogleURLTracker and IntranetRedirectDetector instances, which 1655 // the global GoogleURLTracker and IntranetRedirectDetector instances, which
1653 // will promptly go to sleep for five and seven seconds, respectively (to 1656 // will promptly go to sleep for five and seven seconds, respectively (to
1654 // avoid slowing startup), and wake up afterwards to see if they should do 1657 // avoid slowing startup), and wake up afterwards to see if they should do
1655 // anything else. 1658 // anything else.
1656 // 1659 //
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1966 if (base::win::GetVersion() <= base::win::VERSION_XP) 1969 if (base::win::GetVersion() <= base::win::VERSION_XP)
1967 uma_name += "_XP"; 1970 uma_name += "_XP";
1968 1971
1969 uma_name += "_PreRead_"; 1972 uma_name += "_PreRead_";
1970 uma_name += pre_read_percentage; 1973 uma_name += pre_read_percentage;
1971 AddPreReadHistogramTime(uma_name.c_str(), time); 1974 AddPreReadHistogramTime(uma_name.c_str(), time);
1972 } 1975 }
1973 #endif 1976 #endif
1974 #endif 1977 #endif
1975 } 1978 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698