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

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 8343052: Sync Promo: Tweak first tabs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: diff against correct branch Created 9 years, 2 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
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index c1a8d50cb2aa3363a09f5557752e37bd4f083153..dc9ea2491ab5460a398a3e5578fd939b6482c931 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -52,6 +52,7 @@
#include "chrome/browser/net/predictor.h"
#include "chrome/browser/net/pref_proxy_config_service.h"
#include "chrome/browser/net/ssl_config_service_manager.h"
+#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/password_manager/password_store_default.h"
#include "chrome/browser/plugin_prefs.h"
#include "chrome/browser/policy/configuration_policy_pref_store.h"
@@ -91,6 +92,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/spellcheck_messages.h"
+#include "chrome/common/url_constants.h"
#include "content/browser/appcache/chrome_appcache_service.h"
#include "content/browser/browser_thread.h"
#include "content/browser/chrome_blob_storage_context.h"
@@ -1679,6 +1681,33 @@ void ProfileImpl::ClearNetworkingHistorySince(base::Time time) {
io_data_.ClearNetworkingHistorySince(time);
}
+GURL ProfileImpl::GetHomePage() {
+ // --homepage overrides any preferences.
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kHomePage)) {
+ // TODO(evanm): clean up usage of DIR_CURRENT.
+ // http://code.google.com/p/chromium/issues/detail?id=60630
+ // For now, allow this code to call getcwd().
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+
+ FilePath browser_directory;
+ PathService::Get(base::DIR_CURRENT, &browser_directory);
+ GURL home_page(URLFixerUpper::FixupRelativeFile(browser_directory,
+ command_line.GetSwitchValuePath(switches::kHomePage)));
+ if (home_page.is_valid())
+ return home_page;
+ }
+
+ if (GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage))
+ return GURL(chrome::kChromeUINewTabURL);
+ GURL home_page(URLFixerUpper::FixupURL(
+ GetPrefs()->GetString(prefs::kHomePage),
+ std::string()));
+ if (!home_page.is_valid())
+ return GURL(chrome::kChromeUINewTabURL);
+ return home_page;
+}
+
SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() {
if (!spellcheck_profile_.get())
spellcheck_profile_.reset(new SpellCheckProfile(path_));
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698