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

Unified Diff: chrome/browser/ui/ash/system_tray_common.cc

Issue 2373863002: mustash: Connect ash system tray "show settings" items to chrome over mojo (Closed)
Patch Set: review comments Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/ash/system_tray_common.h ('k') | chrome/browser/ui/ash/system_tray_delegate_chromeos.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/system_tray_common.cc
diff --git a/chrome/browser/ui/ash/system_tray_common.cc b/chrome/browser/ui/ash/system_tray_common.cc
index d1be323396aa89b232b1393fa77e5b16f055b2d4..c869c3f39001bee2f9f3f3be1d5b91316b4a35e4 100644
--- a/chrome/browser/ui/ash/system_tray_common.cc
+++ b/chrome/browser/ui/ash/system_tray_common.cc
@@ -4,13 +4,42 @@
#include "chrome/browser/ui/ash/system_tray_common.h"
+#include "base/logging.h"
+#include "chrome/browser/chromeos/accessibility/accessibility_util.h"
+#include "chrome/browser/chromeos/login/ui/login_display_host.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
+#include "chrome/browser/ui/singleton_tabs.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
+#include "chromeos/login/login_state.h"
#include "content/public/browser/user_metrics.h"
#include "ui/base/l10n/l10n_util.h"
+using chromeos::LoginState;
+
+namespace {
+
+const char kPaletteSettingsSubPageName[] = "stylus-overlay";
+
+void ShowSettingsSubPageForActiveUser(const std::string& sub_page) {
+ chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(),
+ sub_page);
+}
+
+} // namespace
+
+// static
+const char SystemTrayCommon::kDisplaySettingsSubPageName[] = "display";
+const char SystemTrayCommon::kDisplayOverscanSettingsSubPageName[] =
+ "displayOverscan";
+
+// static
+void SystemTrayCommon::ShowSettings() {
+ ShowSettingsSubPageForActiveUser(std::string());
+}
+
// static
void SystemTrayCommon::ShowDateSettings() {
content::RecordAction(base::UserMetricsAction("ShowDateOptions"));
@@ -21,3 +50,74 @@ void SystemTrayCommon::ShowDateSettings() {
chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(),
sub_page);
}
+
+// static
+void SystemTrayCommon::ShowDisplaySettings() {
+ content::RecordAction(base::UserMetricsAction("ShowDisplayOptions"));
+ ShowSettingsSubPageForActiveUser(kDisplaySettingsSubPageName);
+}
+
+// static
+void SystemTrayCommon::ShowChromeSlow() {
+ chrome::ScopedTabbedBrowserDisplayer displayer(
+ ProfileManager::GetPrimaryUserProfile());
+ chrome::ShowSlow(displayer.browser());
+}
+
+// static
+void SystemTrayCommon::ShowIMESettings() {
+ content::RecordAction(base::UserMetricsAction("OpenLanguageOptionsDialog"));
+ ShowSettingsSubPageForActiveUser(chrome::kLanguageOptionsSubPage);
+}
+
+// static
+void SystemTrayCommon::ShowHelp() {
+ chrome::ShowHelpForProfile(ProfileManager::GetActiveUserProfile(),
+ chrome::HELP_SOURCE_MENU);
+}
+
+// static
+void SystemTrayCommon::ShowAccessibilityHelp() {
+ chrome::ScopedTabbedBrowserDisplayer displayer(
+ ProfileManager::GetActiveUserProfile());
+ chromeos::accessibility::ShowAccessibilityHelp(displayer.browser());
+}
+
+// static
+void SystemTrayCommon::ShowAccessibilitySettings() {
+ content::RecordAction(base::UserMetricsAction("ShowAccessibilitySettings"));
+ std::string sub_page = std::string(chrome::kSearchSubPage) + "#" +
+ l10n_util::GetStringUTF8(
+ IDS_OPTIONS_SETTINGS_SECTION_TITLE_ACCESSIBILITY);
+ ShowSettingsSubPageForActiveUser(sub_page);
+}
+
+// static
+void SystemTrayCommon::ShowPaletteHelp() {
+ chrome::ScopedTabbedBrowserDisplayer displayer(
+ ProfileManager::GetActiveUserProfile());
+ chrome::ShowSingletonTab(displayer.browser(),
+ GURL(chrome::kChromePaletteHelpURL));
+}
+
+// static
+void SystemTrayCommon::ShowPaletteSettings() {
+ content::RecordAction(base::UserMetricsAction("ShowPaletteOptions"));
+ ShowSettingsSubPageForActiveUser(kPaletteSettingsSubPageName);
+}
+
+// static
+void SystemTrayCommon::ShowPublicAccountInfo() {
+ chrome::ScopedTabbedBrowserDisplayer displayer(
+ ProfileManager::GetActiveUserProfile());
+ chrome::ShowPolicy(displayer.browser());
+}
+
+// static
+void SystemTrayCommon::ShowProxySettings() {
+ LoginState* login_state = LoginState::Get();
+ // User is not logged in.
+ CHECK(!login_state->IsUserLoggedIn() ||
+ login_state->GetLoggedInUserType() == LoginState::LOGGED_IN_USER_NONE);
+ chromeos::LoginDisplayHost::default_host()->OpenProxySettings();
+}
« no previous file with comments | « chrome/browser/ui/ash/system_tray_common.h ('k') | chrome/browser/ui/ash/system_tray_delegate_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698