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

Unified Diff: chrome/browser/chromeos/browser_main_chromeos.cc

Issue 7840041: Refactor some more BrowserMain code. Move core code that's required by all embedders to content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/browser_main_chromeos.cc
===================================================================
--- chrome/browser/chromeos/browser_main_chromeos.cc (revision 100153)
+++ chrome/browser/chromeos/browser_main_chromeos.cc (working copy)
@@ -10,6 +10,7 @@
#include "chrome/browser/chromeos/boot_times_loader.h"
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h"
+#include "chrome/browser/defaults.h"
#include "chrome/common/chrome_switches.h"
#include "content/common/main_function_params.h"
#include "net/base/network_change_notifier.h"
@@ -63,7 +64,19 @@
chromeos::BootTimesLoader::Get()->WriteLogoutTimes();
}
+void BrowserMainPartsChromeos::PreEarlyInitialization() {
+ BrowserMainPartsGtk::PreEarlyInitialization();
+ if (parsed_command_line().HasSwitch(switches::kGuestSession)) {
+ // Disable sync and extensions if we're in "browse without sign-in" mode.
+ CommandLine* singleton_command_line = CommandLine::ForCurrentProcess();
+ singleton_command_line->AppendSwitch(switches::kDisableSync);
+ singleton_command_line->AppendSwitch(switches::kDisableExtensions);
+ browser_defaults::bookmarks_enabled = false;
+ }
+}
+
void BrowserMainPartsChromeos::PreMainMessageLoopStart() {
+ BrowserMainPartsGtk::PreMainMessageLoopStart();
// Initialize CrosLibrary only for the browser, unless running tests
// (which do their own CrosLibrary setup).
if (!parameters().ui_task) {
@@ -77,7 +90,7 @@
}
void BrowserMainPartsChromeos::PostMainMessageLoopStart() {
- BrowserMainPartsPosix::PostMainMessageLoopStart();
+ BrowserMainPartsGtk::PostMainMessageLoopStart();
tony 2011/09/08 17:21:04 Posix seems better here since there is no BrowserM
jam 2011/09/08 17:43:01 ok. it seemed odd to me that it wouldn't call its
MessageLoopForUI* message_loop = MessageLoopForUI::current();
message_loop->AddObserver(g_message_loop_observer.Pointer());
}

Powered by Google App Engine
This is Rietveld 408576698