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

Unified Diff: chrome/browser/interstitials/chrome_controller_client.cc

Issue 2459193003: Open ChromeOS clock settings on the UI thread instead of File. (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/interstitials/chrome_controller_client.cc
diff --git a/chrome/browser/interstitials/chrome_controller_client.cc b/chrome/browser/interstitials/chrome_controller_client.cc
index 6f6e30f26488e3aef27b92e67a49cc9ef4c8a3c2..abab48a23504ad65f2b0228d8e60df98285b30aa 100644
--- a/chrome/browser/interstitials/chrome_controller_client.cc
+++ b/chrome/browser/interstitials/chrome_controller_client.cc
@@ -42,24 +42,17 @@ using content::Referrer;
namespace {
-void LaunchDateAndTimeSettingsOnFile() {
+void LaunchDateAndTimeSettingsOnFileThread() {
DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
// The code for each OS is completely separate, in order to avoid bugs like
-// https://crbug.com/430877 .
+// https://crbug.com/430877 . ChromeOS is handled on the UI thread.
#if defined(OS_ANDROID)
chrome::android::OpenDateAndTimeSettings();
estark 2016/10/31 19:02:49 I wonder if this should be on the UI thread as wel
meacer 2016/10/31 21:38:22 Yeah, I was wondering the same thing. I don't kn
-#elif defined(OS_CHROMEOS)
- std::string sub_page =
- std::string(chrome::kSearchSubPage) + "#" +
- l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME);
- chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(),
- sub_page);
-
#elif defined(OS_LINUX)
struct ClockCommand {
- const char* pathname;
- const char* argument;
+ const char* const pathname;
+ const char* const argument;
};
static const ClockCommand kClockCommands[] = {
// Unity
@@ -150,9 +143,19 @@ bool ChromeControllerClient::CanLaunchDateAndTimeSettings() {
}
void ChromeControllerClient::LaunchDateAndTimeSettings() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+#if defined(OS_CHROMEOS)
+ const std::string sub_page =
+ std::string(chrome::kSearchSubPage) + "#" +
+ l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME);
+ chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(),
+ sub_page);
+#else
content::BrowserThread::PostTask(
content::BrowserThread::FILE, FROM_HERE,
- base::Bind(&LaunchDateAndTimeSettingsOnFile));
+ base::Bind(&LaunchDateAndTimeSettingsOnFileThread));
+#endif
}
void ChromeControllerClient::GoBack() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698