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

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: Exclude code in ChromeOS 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 3051be54ded24b18ad96fd0af63a95c73e38ee70..aca6d3e2fd1e7e9e3d5110c26be06e4c6c088d53 100644
--- a/chrome/browser/interstitials/chrome_controller_client.cc
+++ b/chrome/browser/interstitials/chrome_controller_client.cc
@@ -41,21 +41,18 @@ using content::Referrer;
namespace {
-void LaunchDateAndTimeSettingsOnFile() {
+#if !defined(OS_CHROMEOS)
+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();
-#elif defined(OS_CHROMEOS)
- chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(),
- chrome::kDateTimeSubPage);
-
#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
@@ -119,6 +116,7 @@ void LaunchDateAndTimeSettingsOnFile() {
#endif
// Don't add code here! (See the comment at the beginning of the function.)
}
+#endif
} // namespace
@@ -146,9 +144,16 @@ bool ChromeControllerClient::CanLaunchDateAndTimeSettings() {
}
void ChromeControllerClient::LaunchDateAndTimeSettings() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+#if defined(OS_CHROMEOS)
+ chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(),
+ chrome::kDateTimeSubPage);
+#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