diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-25 01:27:31 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-25 01:27:31 +0000 |
commit | 04999e660bef3b6df5518acea9749878af736b8e (patch) | |
tree | 9dcc816280dfd032b39a40813bfdb6a7fdca7793 /chrome/browser | |
parent | 26f34dd42f1af46a4c68e9082290c359706685db (diff) | |
download | chromium_src-04999e660bef3b6df5518acea9749878af736b8e.zip chromium_src-04999e660bef3b6df5518acea9749878af736b8e.tar.gz chromium_src-04999e660bef3b6df5518acea9749878af736b8e.tar.bz2 |
linux: drop temp_scaffolding_stubs
It was mostly unneeded, but I had to excise the last bits of RLZ and move
some NOTIMPLEMENTED bits to where they belong.
Review URL: http://codereview.chromium.org/219042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27161 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser_main.cc | 12 | ||||
-rw-r--r-- | chrome/browser/browser_shutdown.cc | 8 | ||||
-rw-r--r-- | chrome/browser/download/download_util.cc | 8 | ||||
-rw-r--r-- | chrome/browser/first_run_gtk.cc | 16 | ||||
-rw-r--r-- | chrome/browser/search_engines/template_url.cc | 11 | ||||
-rw-r--r-- | chrome/browser/search_engines/template_url_model.cc | 2 |
6 files changed, 49 insertions, 8 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 99380a4..2079944 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -278,7 +278,6 @@ int BrowserMain(const MainFunctionParams& parameters) { const char* thread_name = thread_name_string.c_str(); PlatformThread::SetName(thread_name); main_message_loop.set_thread_name(thread_name); - bool already_running = Upgrade::IsBrowserAlreadyRunning(); // Register the main thread by instantiating it, but don't call any methods. ChromeThread main_thread; @@ -436,7 +435,7 @@ int BrowserMain(const MainFunctionParams& parameters) { int rlz_ping_delay = 0; bool homepage_defined = false; if (is_first_run) { - // On first run, we need to process the master preferences before the + // On first run, we need to process the master preferences before the // browser's profile_manager object is created, but after ResourceBundle // is initialized. std::vector<std::wstring> first_run_tabs; @@ -551,12 +550,17 @@ int BrowserMain(const MainFunctionParams& parameters) { #if defined(OS_WIN) // Record last shutdown time into a histogram. browser_shutdown::ReadLastShutdownInfo(); -#endif + + // On Windows, we use our startup as an opportunity to do upgrade/uninstall + // tasks. Those care whether the browser is already running. On Linux/Mac, + // upgrade/uninstall happen separately. + bool already_running = Upgrade::IsBrowserAlreadyRunning(); // If the command line specifies 'uninstall' then we need to work here // unless we detect another chrome browser running. if (parsed_command_line.HasSwitch(switches::kUninstall)) return DoUninstallTasks(already_running); +#endif if (parsed_command_line.HasSwitch(switches::kHideIcons) || parsed_command_line.HasSwitch(switches::kShowIcons)) { @@ -594,10 +598,12 @@ int BrowserMain(const MainFunctionParams& parameters) { NOTREACHED(); } +#if defined(OS_WIN) // Do the tasks if chrome has been upgraded while it was last running. if (!already_running && DoUpgradeTasks(parsed_command_line)) { return ResultCodes::NORMAL_EXIT; } +#endif // Check if there is any machine level Chrome installed on the current // machine. If yes and the current Chrome process is user level, we do not diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc index 971b262..3e8622a 100644 --- a/chrome/browser/browser_shutdown.cc +++ b/chrome/browser/browser_shutdown.cc @@ -22,13 +22,15 @@ #include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/render_widget_host.h" -#include "chrome/browser/rlz/rlz.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" #include "chrome/common/chrome_plugin_lib.h" #include "net/dns_global.h" +#if defined(OS_WIN) +#include "chrome/browser/rlz/rlz.h" +#endif using base::Time; using base::TimeDelta; @@ -131,9 +133,11 @@ void Shutdown() { prefs->SavePersistentPrefs(); +#if defined(OS_WIN) // Cleanup any statics created by RLZ. Must be done before NotificationService // is destroyed. RLZTracker::CleanupRlz(); +#endif // The jank'o'meter requires that the browser process has been destroyed // before calling UninstallJankometer(). @@ -146,11 +150,11 @@ void Shutdown() { if (delete_resources_on_shutdown) ResourceBundle::CleanupSharedInstance(); +#if defined(OS_WIN) if (!Upgrade::IsBrowserAlreadyRunning()) { Upgrade::SwapNewChromeExeIfPresent(); } -#if defined(OS_WIN) if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { // Measure total shutdown time as late in the process as possible // and then write it to a file to be read at startup. diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index c52780b..e7650d5 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -287,6 +287,12 @@ void DragDownload(const DownloadItem* download, widget->DoDrag(data, DragDropTypes::DRAG_COPY | DragDropTypes::DRAG_LINK); #endif // OS_WIN } -#endif +#elif defined(OS_LINUX) +void DragDownload(const DownloadItem* download, + SkBitmap* icon, + gfx::NativeView view) { + NOTIMPLEMENTED(); +} +#endif // OS_LINUX } // namespace download_util diff --git a/chrome/browser/first_run_gtk.cc b/chrome/browser/first_run_gtk.cc index dcd6074..4a78983 100644 --- a/chrome/browser/first_run_gtk.cc +++ b/chrome/browser/first_run_gtk.cc @@ -1,4 +1,3 @@ - // Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -13,3 +12,18 @@ bool OpenFirstRunDialog(Profile* profile, bool homepage_defined, // while this process is active. return FirstRunDialog::Show(profile); } + +bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir, + const FilePath& master_prefs_path, + std::vector<std::wstring>* new_tabs, + int* ping_delay, + bool* homepage_defined) { + NOTIMPLEMENTED(); + return true; +} + +// static +int FirstRun::ImportNow(Profile* profile, const CommandLine& cmdline) { + // http://code.google.com/p/chromium/issues/detail?id=11971 + return 0; +} diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc index 2084780..b550a8d 100644 --- a/chrome/browser/search_engines/template_url.cc +++ b/chrome/browser/search_engines/template_url.cc @@ -9,11 +9,14 @@ #include "base/logging.h" #include "base/string_util.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/rlz/rlz.h" #include "chrome/browser/google_url_tracker.h" #include "chrome/browser/search_engines/template_url_model.h" #include "net/base/escape.h" +#if defined(OS_WIN) +#include "chrome/browser/rlz/rlz.h" +#endif + // The TemplateURLRef has any number of terms that need to be replaced. Each of // the terms is enclosed in braces. If the character preceeding the final // brace is a ?, it indicates the term is optional and can be replaced with @@ -298,6 +301,11 @@ std::wstring TemplateURLRef::ReplaceSearchTerms( break; case GOOGLE_RLZ: { + // On platforms that don't have RLZ, we still want this branch + // to happen so that we replace the RLZ template with the + // empty string. (If we don't handle this case, we hit a + // NOTREACHED below.) +#if defined(OS_WIN) std::wstring rlz_string; RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz_string); if (!rlz_string.empty()) { @@ -305,6 +313,7 @@ std::wstring TemplateURLRef::ReplaceSearchTerms( url.insert(i->index, rlz_string); } break; +#endif } case GOOGLE_UNESCAPED_SEARCH_TERMS: { diff --git a/chrome/browser/search_engines/template_url_model.cc b/chrome/browser/search_engines/template_url_model.cc index cf78196..c4c6103 100644 --- a/chrome/browser/search_engines/template_url_model.cc +++ b/chrome/browser/search_engines/template_url_model.cc @@ -509,9 +509,11 @@ void TemplateURLModel::SetDefaultSearchProvider(const TemplateURL* url) { const TemplateURLRef* url_ref = url->url(); if (url_ref && url_ref->HasGoogleBaseURLs()) { GoogleURLTracker::RequestServerCheck(); +#if defined(OS_WIN) RLZTracker::RecordProductEvent(RLZTracker::CHROME, RLZTracker::CHROME_OMNIBOX, RLZTracker::SET_TO_GOOGLE); +#endif } } |