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

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: gclient sync, ignore 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::AutoStartRequested(
652 FilePath(), 652 profile_path.BaseName().value(),
653 profile_path.BaseName().value()))); 653 true, // Window requested.
654 FilePath())));
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 enable ? base::Bind(&auto_launch_util::EnableForegroundStartAtLogin,
887 FilePath(), profile->GetPath().BaseName().value())); 888 profile->GetPath().BaseName().value(), FilePath()) :
889 base::Bind(&auto_launch_util::DisableForegroundStartAtLogin,
890 profile->GetPath().BaseName().value()));
888 #endif // OS_WIN 891 #endif // OS_WIN
889 } 892 }
890 893
891 void BrowserOptionsHandler::GetInstantFieldTrialStatus(const ListValue* args) { 894 void BrowserOptionsHandler::GetInstantFieldTrialStatus(const ListValue* args) {
892 Profile* profile = Profile::FromWebUI(web_ui()); 895 Profile* profile = Profile::FromWebUI(web_ui());
893 base::FundamentalValue enabled( 896 base::FundamentalValue enabled(
894 InstantFieldTrial::IsInstantExperiment(profile) && 897 InstantFieldTrial::IsInstantExperiment(profile) &&
895 !InstantFieldTrial::IsHiddenExperiment(profile)); 898 !InstantFieldTrial::IsHiddenExperiment(profile));
896 web_ui()->CallJavascriptFunction("BrowserOptions.setInstantFieldTrialStatus", 899 web_ui()->CallJavascriptFunction("BrowserOptions.setInstantFieldTrialStatus",
897 enabled); 900 enabled);
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 } 1411 }
1409 1412
1410 void BrowserOptionsHandler::SetupSSLConfigSettings() { 1413 void BrowserOptionsHandler::SetupSSLConfigSettings() {
1411 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); 1414 base::FundamentalValue checked(rev_checking_enabled_.GetValue());
1412 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); 1415 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged());
1413 web_ui()->CallJavascriptFunction( 1416 web_ui()->CallJavascriptFunction(
1414 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); 1417 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled);
1415 } 1418 }
1416 1419
1417 } // namespace options2 1420 } // namespace options2
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698