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

Side by Side Diff: chrome/browser/ui/webui/options2/browser_options_handler2.cc

Issue 9972012: Resolve the conflict that auto-launch has with the background mode feature (part 1). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/options2/browser_options_handler2.h" 5 #include "chrome/browser/ui/webui/options2/browser_options_handler2.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 // Auto-launch is not supported for secondary profiles yet. 641 // Auto-launch is not supported for secondary profiles yet.
642 if (profile_path.BaseName().value() != ASCIIToUTF16(chrome::kInitialProfile)) 642 if (profile_path.BaseName().value() != ASCIIToUTF16(chrome::kInitialProfile))
643 return; 643 return;
644 644
645 // Pass in weak pointer to this to avoid race if BrowserOptionsHandler is 645 // Pass in weak pointer to this to avoid race if BrowserOptionsHandler is
646 // deleted. 646 // deleted.
647 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 647 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
648 base::Bind(&BrowserOptionsHandler::CheckAutoLaunchCallback, 648 base::Bind(&BrowserOptionsHandler::CheckAutoLaunchCallback,
649 weak_this, 649 weak_this,
650 auto_launch_trial::IsInAutoLaunchGroup(), 650 auto_launch_trial::IsInAutoLaunchGroup(),
651 auto_launch_util::WillLaunchAtLogin( 651 auto_launch_util::LaunchWithWindowAtLoginRequested(
652 FilePath(), 652 FilePath(),
653 profile_path.BaseName().value()))); 653 profile_path.BaseName().value())));
654 #endif 654 #endif
655 } 655 }
656 656
657 void BrowserOptionsHandler::CheckAutoLaunchCallback( 657 void BrowserOptionsHandler::CheckAutoLaunchCallback(
658 bool is_in_auto_launch_group, 658 bool is_in_auto_launch_group,
659 bool will_launch_at_login) { 659 bool will_launch_at_login) {
660 #if defined(OS_WIN) 660 #if defined(OS_WIN)
661 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 661 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 876
877 bool enable; 877 bool enable;
878 CHECK_EQ(args->GetSize(), 1U); 878 CHECK_EQ(args->GetSize(), 1U);
879 CHECK(args->GetBoolean(0, &enable)); 879 CHECK(args->GetBoolean(0, &enable));
880 880
881 // Make sure we keep track of how many disable and how many enable. 881 // Make sure we keep track of how many disable and how many enable.
882 auto_launch_trial::UpdateToggleAutoLaunchMetric(enable); 882 auto_launch_trial::UpdateToggleAutoLaunchMetric(enable);
883 Profile* profile = Profile::FromWebUI(web_ui()); 883 Profile* profile = Profile::FromWebUI(web_ui());
884 content::BrowserThread::PostTask( 884 content::BrowserThread::PostTask(
885 content::BrowserThread::FILE, FROM_HERE, 885 content::BrowserThread::FILE, FROM_HERE,
886 base::Bind(&auto_launch_util::SetWillLaunchAtLogin, enable, 886 enable ? base::Bind(&auto_launch_util::EnableAutoStartAtLogin,
887 FilePath(), profile->GetPath().BaseName().value())); 887 FilePath(), profile->GetPath().BaseName().value()) :
888 base::Bind(&auto_launch_util::DisableAutoStartAtLogin,
889 profile->GetPath().BaseName().value()));
888 #endif // OS_WIN 890 #endif // OS_WIN
889 } 891 }
890 892
891 void BrowserOptionsHandler::GetInstantFieldTrialStatus(const ListValue* args) { 893 void BrowserOptionsHandler::GetInstantFieldTrialStatus(const ListValue* args) {
892 Profile* profile = Profile::FromWebUI(web_ui()); 894 Profile* profile = Profile::FromWebUI(web_ui());
893 base::FundamentalValue enabled( 895 base::FundamentalValue enabled(
894 InstantFieldTrial::IsInstantExperiment(profile) && 896 InstantFieldTrial::IsInstantExperiment(profile) &&
895 !InstantFieldTrial::IsHiddenExperiment(profile)); 897 !InstantFieldTrial::IsHiddenExperiment(profile));
896 web_ui()->CallJavascriptFunction("BrowserOptions.setInstantFieldTrialStatus", 898 web_ui()->CallJavascriptFunction("BrowserOptions.setInstantFieldTrialStatus",
897 enabled); 899 enabled);
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 } 1410 }
1409 1411
1410 void BrowserOptionsHandler::SetupSSLConfigSettings() { 1412 void BrowserOptionsHandler::SetupSSLConfigSettings() {
1411 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); 1413 base::FundamentalValue checked(rev_checking_enabled_.GetValue());
1412 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); 1414 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged());
1413 web_ui()->CallJavascriptFunction( 1415 web_ui()->CallJavascriptFunction(
1414 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); 1416 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled);
1415 } 1417 }
1416 1418
1417 } // namespace options2 1419 } // namespace options2
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698