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

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::WillLaunchAtLoginWithSwitch(
652 FilePath(), 652 FilePath(),
653 profile_path.BaseName().value()))); 653 profile_path.BaseName().value(),
654 switches::kAutoLaunchAtStartup)));
654 #endif 655 #endif
655 } 656 }
656 657
657 void BrowserOptionsHandler::CheckAutoLaunchCallback( 658 void BrowserOptionsHandler::CheckAutoLaunchCallback(
658 bool is_in_auto_launch_group, 659 bool is_in_auto_launch_group,
659 bool will_launch_at_login) { 660 bool will_launch_at_login) {
660 #if defined(OS_WIN) 661 #if defined(OS_WIN)
661 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 662 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
662 663
663 if (is_in_auto_launch_group) { 664 if (is_in_auto_launch_group) {
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 877
877 bool enable; 878 bool enable;
878 CHECK_EQ(args->GetSize(), 1U); 879 CHECK_EQ(args->GetSize(), 1U);
879 CHECK(args->GetBoolean(0, &enable)); 880 CHECK(args->GetBoolean(0, &enable));
880 881
881 // Make sure we keep track of how many disable and how many enable. 882 // Make sure we keep track of how many disable and how many enable.
882 auto_launch_trial::UpdateToggleAutoLaunchMetric(enable); 883 auto_launch_trial::UpdateToggleAutoLaunchMetric(enable);
883 Profile* profile = Profile::FromWebUI(web_ui()); 884 Profile* profile = Profile::FromWebUI(web_ui());
884 content::BrowserThread::PostTask( 885 content::BrowserThread::PostTask(
885 content::BrowserThread::FILE, FROM_HERE, 886 content::BrowserThread::FILE, FROM_HERE,
886 base::Bind(&auto_launch_util::SetWillLaunchAtLogin, enable, 887 base::Bind(&auto_launch_util::SetWillLaunchAtLogin,
887 FilePath(), profile->GetPath().BaseName().value())); 888 FilePath(), profile->GetPath().BaseName().value(),
889 enable ? auto_launch_util::FLAG_ENABLE : // Auto-launch.
890 auto_launch_util::FLAG_DISABLE,
891 auto_launch_util::FLAG_PRESERVE)); // Background mode.
888 #endif // OS_WIN 892 #endif // OS_WIN
889 } 893 }
890 894
891 void BrowserOptionsHandler::GetInstantFieldTrialStatus(const ListValue* args) { 895 void BrowserOptionsHandler::GetInstantFieldTrialStatus(const ListValue* args) {
892 Profile* profile = Profile::FromWebUI(web_ui()); 896 Profile* profile = Profile::FromWebUI(web_ui());
893 base::FundamentalValue enabled( 897 base::FundamentalValue enabled(
894 InstantFieldTrial::IsInstantExperiment(profile) && 898 InstantFieldTrial::IsInstantExperiment(profile) &&
895 !InstantFieldTrial::IsHiddenExperiment(profile)); 899 !InstantFieldTrial::IsHiddenExperiment(profile));
896 web_ui()->CallJavascriptFunction("BrowserOptions.setInstantFieldTrialStatus", 900 web_ui()->CallJavascriptFunction("BrowserOptions.setInstantFieldTrialStatus",
897 enabled); 901 enabled);
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 } 1412 }
1409 1413
1410 void BrowserOptionsHandler::SetupSSLConfigSettings() { 1414 void BrowserOptionsHandler::SetupSSLConfigSettings() {
1411 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); 1415 base::FundamentalValue checked(rev_checking_enabled_.GetValue());
1412 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); 1416 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged());
1413 web_ui()->CallJavascriptFunction( 1417 web_ui()->CallJavascriptFunction(
1414 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); 1418 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled);
1415 } 1419 }
1416 1420
1417 } // namespace options2 1421 } // namespace options2
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698