summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-05 18:34:21 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-05 18:34:21 +0000
commit7f0ebc9a390a168a412c4b4a217761d7d72d4b25 (patch)
treee11edec9779aa2bc9ba5896703a927ec8eb22e9e
parentfaa138bef55364f6552c0c50dc3d1616a10201d0 (diff)
downloadchromium_src-7f0ebc9a390a168a412c4b4a217761d7d72d4b25.zip
chromium_src-7f0ebc9a390a168a412c4b4a217761d7d72d4b25.tar.gz
chromium_src-7f0ebc9a390a168a412c4b4a217761d7d72d4b25.tar.bz2
Add some more scaffolding, enable some browser_main code on linux.
Review URL: http://codereview.chromium.org/21067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9227 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browser_main.cc23
-rw-r--r--chrome/common/temp_scaffolding_stubs.cc3
-rw-r--r--chrome/common/temp_scaffolding_stubs.h5
3 files changed, 16 insertions, 15 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 375e06f..4b1280e 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -25,6 +25,7 @@
#include "chrome/browser/browser_prefs.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_process_impl.h"
+#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/first_run.h"
#include "chrome/browser/plugin_service.h"
#include "chrome/browser/profile_manager.h"
@@ -37,6 +38,7 @@
#include "chrome/common/main_function_params.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
+#include "chrome/common/resource_bundle.h"
#include "chromium_strings.h"
#include "generated_resources.h"
@@ -61,7 +63,6 @@
#include "base/win_util.h"
#include "chrome/browser/automation/automation_provider.h"
#include "chrome/browser/browser.h"
-#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/browser_trial.h"
#include "chrome/browser/dom_ui/chrome_url_data_manager.h"
#include "chrome/browser/extensions/extension_protocols.h"
@@ -79,7 +80,6 @@
#include "chrome/browser/user_data_manager.h"
#include "chrome/browser/views/user_data_dir_dialog.h"
#include "chrome/common/env_vars.h"
-#include "chrome/common/resource_bundle.h"
#include "chrome/common/win_util.h"
#include "chrome/installer/util/google_update_settings.h"
#include "chrome/installer/util/helper.h"
@@ -94,8 +94,10 @@
#include "net/http/http_network_layer.h"
#include "sandbox/src/sandbox.h"
-#include "net_resources.h"
+#endif // defined(OS_WIN)
+#if !defined(OS_MACOSX)
+#include "net_resources.h"
#endif
namespace Platform {
@@ -134,7 +136,7 @@ void HandleErrorTestParameters(const CommandLine& command_line) {
}
}
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(OS_LINUX)
// The net module doesn't have access to this HTML or the strings that need to
// be localized. The Chrome locale will never change while we're running, so
// it's safe to have a static string that we always return a pointer into.
@@ -173,7 +175,7 @@ StringPiece NetResourceProvider(int key) {
return ResourceBundle::GetSharedInstance().GetRawDataResource(key);
}
-#endif
+#endif // defined(OS_WIN) || defined(OS_LINUX)
void RunUIMessageLoop(BrowserProcess* browser_process) {
#if defined(OS_WIN)
@@ -302,7 +304,7 @@ int BrowserMain(const MainFunctionParams& parameters) {
parent_local_state.GetString(prefs::kApplicationLocale));
}
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(OS_LINUX)
// If we're running tests (ui_task is non-null), then the ResourceBundle
// has already been initialized.
if (!parameters.ui_task) {
@@ -311,7 +313,7 @@ int BrowserMain(const MainFunctionParams& parameters) {
// We only load the theme dll in the browser process.
ResourceBundle::GetSharedInstance().LoadThemeResources();
}
-#endif
+#endif // defined(OS_WIN) || defined(OS_LINUX)
if (!parsed_command_line.HasSwitch(switches::kNoErrorDialogs)) {
// Display a warning if the user is running windows 2000.
@@ -333,6 +335,11 @@ int BrowserMain(const MainFunctionParams& parameters) {
#if defined(OS_WIN)
user_data_dir = FilePath::FromWStringHack(
UserDataDirDialog::RunUserDataDirDialog(user_data_dir.ToWStringHack()));
+#elif defined(OS_LINUX)
+ // TODO(port): fix this.
+ user_data_dir = FilePath("/tmp");
+#endif
+#if defined(OS_WIN) || defined(OS_LINUX)
// Flush the message loop which lets the UserDataDirDialog close.
MessageLoop::current()->Run();
@@ -355,7 +362,7 @@ int BrowserMain(const MainFunctionParams& parameters) {
}
return ResultCodes::NORMAL_EXIT;
-#endif
+#endif // defined(OS_WIN) || defined(OS_LINUX)
}
PrefService* user_prefs = profile->GetPrefs();
diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc
index b70d2fd..7267057 100644
--- a/chrome/common/temp_scaffolding_stubs.cc
+++ b/chrome/common/temp_scaffolding_stubs.cc
@@ -32,7 +32,6 @@
#include "chrome/common/process_watcher.h"
#include "chrome/common/resource_bundle.h"
#include "net/url_request/url_request_context.h"
-#include "webkit/glue/webcursor.h"
// static
size_t SessionRestore::num_tabs_to_load_ = 0;
@@ -67,12 +66,12 @@ bool ShellIntegration::IsDefaultBrowser() {
//--------------------------------------------------------------------------
namespace browser_shutdown {
+bool delete_resources_on_shutdown = true;
void ReadLastShutdownInfo() { NOTIMPLEMENTED(); }
void Shutdown() { NOTIMPLEMENTED(); }
void OnShutdownStarting(ShutdownType type) { NOTIMPLEMENTED(); }
}
-
// static
bool FirstRun::IsChromeFirstRun() {
NOTIMPLEMENTED();
diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h
index 23ab507..e11cc76 100644
--- a/chrome/common/temp_scaffolding_stubs.h
+++ b/chrome/common/temp_scaffolding_stubs.h
@@ -262,11 +262,6 @@ class MetricsService {
void RecordStartOfSessionEnd() { NOTIMPLEMENTED(); }
};
-namespace browser_shutdown {
-void ReadLastShutdownInfo();
-void Shutdown();
-}
-
namespace browser {
void RegisterAllPrefs(PrefService*, PrefService*);
}