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

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 9317002: Make the auto-launch experiment profile-aware. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Uploading again post gclient sync (no other changes) Created 8 years, 11 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/ui/webui/options/browser_options_handler.cc
===================================================================
--- chrome/browser/ui/webui/options/browser_options_handler.cc (revision 119922)
+++ chrome/browser/ui/webui/options/browser_options_handler.cc (working copy)
@@ -173,23 +173,30 @@
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
base::Bind(&BrowserOptionsHandler::CheckAutoLaunch,
weak_ptr_factory_for_ui_.GetWeakPtr(),
- weak_ptr_factory_for_file_.GetWeakPtr()));
+ weak_ptr_factory_for_file_.GetWeakPtr(),
+ profile->GetPath()));
weak_ptr_factory_for_ui_.DetachFromThread();
#endif
}
void BrowserOptionsHandler::CheckAutoLaunch(
- base::WeakPtr<BrowserOptionsHandler> weak_this) {
+ base::WeakPtr<BrowserOptionsHandler> weak_this,
+ const FilePath& profile_path) {
#if defined(OS_WIN)
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ // We don't support this for secondary profiles yet.
+ if (profile_path.BaseName().value() != ASCIIToUTF16("Default"))
+ return;
+
// Pass in weak pointer to this to avoid race if BrowserOptionsHandler is
// deleted.
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(&BrowserOptionsHandler::CheckAutoLaunchCallback,
weak_this,
auto_launch_trial::IsInAutoLaunchGroup(),
- auto_launch_util::WillLaunchAtLogin(FilePath())));
+ auto_launch_util::WillLaunchAtLogin(FilePath(),
+ profile_path)));
#endif
}
@@ -206,7 +213,7 @@
base::FundamentalValue enabled(will_launch_at_login);
web_ui()->CallJavascriptFunction("BrowserOptions.updateAutoLaunchState",
- enabled);
+ enabled);
}
#endif
}
@@ -530,9 +537,11 @@
// Make sure we keep track of how many disable and how many enable.
auto_launch_trial::UpdateToggleAutoLaunchMetric(enable);
+ Profile* profile = Profile::FromWebUI(web_ui());
content::BrowserThread::PostTask(
content::BrowserThread::FILE, FROM_HERE,
- base::Bind(&auto_launch_util::SetWillLaunchAtLogin, enable, FilePath()));
+ base::Bind(&auto_launch_util::SetWillLaunchAtLogin, enable,
+ FilePath(), profile->GetPath()));
#endif // OS_WIN
}

Powered by Google App Engine
This is Rietveld 408576698