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

Side by Side Diff: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc

Issue 2455113003: MD Settings: Fix Client Navigations to Search Query URLs (Closed)
Patch Set: merge 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ash/system_tray_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 16 matching lines...) Expand all
27 #include "ash/common/system/tray/system_tray_notifier.h" 27 #include "ash/common/system/tray/system_tray_notifier.h"
28 #include "ash/common/system/tray_accessibility.h" 28 #include "ash/common/system/tray_accessibility.h"
29 #include "ash/common/system/update/update_observer.h" 29 #include "ash/common/system/update/update_observer.h"
30 #include "ash/common/system/user/user_observer.h" 30 #include "ash/common/system/user/user_observer.h"
31 #include "ash/common/wm_shell.h" 31 #include "ash/common/wm_shell.h"
32 #include "ash/shell.h" 32 #include "ash/shell.h"
33 #include "ash/system/chromeos/rotation/tray_rotation_lock.h" 33 #include "ash/system/chromeos/rotation/tray_rotation_lock.h"
34 #include "ash/wm/lock_state_controller.h" 34 #include "ash/wm/lock_state_controller.h"
35 #include "base/bind_helpers.h" 35 #include "base/bind_helpers.h"
36 #include "base/callback.h" 36 #include "base/callback.h"
37 #include "base/feature_list.h"
37 #include "base/logging.h" 38 #include "base/logging.h"
38 #include "base/memory/ptr_util.h" 39 #include "base/memory/ptr_util.h"
39 #include "base/memory/weak_ptr.h" 40 #include "base/memory/weak_ptr.h"
40 #include "base/metrics/user_metrics.h" 41 #include "base/metrics/user_metrics.h"
41 #include "base/strings/stringprintf.h" 42 #include "base/strings/stringprintf.h"
42 #include "base/strings/utf_string_conversions.h" 43 #include "base/strings/utf_string_conversions.h"
43 #include "base/sys_info.h" 44 #include "base/sys_info.h"
44 #include "base/time/time.h" 45 #include "base/time/time.h"
45 #include "chrome/browser/browser_process.h" 46 #include "chrome/browser/browser_process.h"
46 #include "chrome/browser/chrome_notification_types.h" 47 #include "chrome/browser/chrome_notification_types.h"
(...skipping 23 matching lines...) Expand all
70 #include "chrome/browser/ui/ash/networking_config_delegate_chromeos.h" 71 #include "chrome/browser/ui/ash/networking_config_delegate_chromeos.h"
71 #include "chrome/browser/ui/ash/system_tray_client.h" 72 #include "chrome/browser/ui/ash/system_tray_client.h"
72 #include "chrome/browser/ui/ash/system_tray_delegate_utils.h" 73 #include "chrome/browser/ui/ash/system_tray_delegate_utils.h"
73 #include "chrome/browser/ui/ash/vpn_delegate_chromeos.h" 74 #include "chrome/browser/ui/ash/vpn_delegate_chromeos.h"
74 #include "chrome/browser/ui/browser.h" 75 #include "chrome/browser/ui/browser.h"
75 #include "chrome/browser/ui/browser_list.h" 76 #include "chrome/browser/ui/browser_list.h"
76 #include "chrome/browser/ui/chrome_pages.h" 77 #include "chrome/browser/ui/chrome_pages.h"
77 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" 78 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
78 #include "chrome/browser/ui/singleton_tabs.h" 79 #include "chrome/browser/ui/singleton_tabs.h"
79 #include "chrome/browser/upgrade_detector.h" 80 #include "chrome/browser/upgrade_detector.h"
81 #include "chrome/common/chrome_features.h"
80 #include "chrome/common/chrome_switches.h" 82 #include "chrome/common/chrome_switches.h"
81 #include "chrome/common/pref_names.h" 83 #include "chrome/common/pref_names.h"
82 #include "chrome/common/url_constants.h" 84 #include "chrome/common/url_constants.h"
83 #include "chrome/grit/generated_resources.h" 85 #include "chrome/grit/generated_resources.h"
84 #include "chrome/grit/locale_settings.h" 86 #include "chrome/grit/locale_settings.h"
85 #include "chromeos/dbus/dbus_thread_manager.h" 87 #include "chromeos/dbus/dbus_thread_manager.h"
86 #include "chromeos/dbus/session_manager_client.h" 88 #include "chromeos/dbus/session_manager_client.h"
87 #include "chromeos/login/login_state.h" 89 #include "chromeos/login/login_state.h"
88 #include "chromeos/network/portal_detector/network_portal_detector.h" 90 #include "chromeos/network/portal_detector/network_portal_detector.h"
89 #include "components/google/core/browser/google_util.h" 91 #include "components/google/core/browser/google_util.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 input_method::InputMethodSwitchRecorder::Get()->RecordSwitch( 542 input_method::InputMethodSwitchRecorder::Get()->RecordSwitch(
541 true /* by_tray_menu */); 543 true /* by_tray_menu */);
542 } 544 }
543 545
544 void SystemTrayDelegateChromeOS::ActivateIMEProperty(const std::string& key) { 546 void SystemTrayDelegateChromeOS::ActivateIMEProperty(const std::string& key) {
545 input_method::InputMethodManager::Get()->ActivateInputMethodMenuItem(key); 547 input_method::InputMethodManager::Get()->ActivateInputMethodMenuItem(key);
546 } 548 }
547 549
548 void SystemTrayDelegateChromeOS::ManageBluetoothDevices() { 550 void SystemTrayDelegateChromeOS::ManageBluetoothDevices() {
549 content::RecordAction(base::UserMetricsAction("ShowBluetoothSettingsPage")); 551 content::RecordAction(base::UserMetricsAction("ShowBluetoothSettingsPage"));
550 std::string sub_page = 552 std::string sub_page;
551 std::string(chrome::kSearchSubPage) + "#" + 553 if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings)) {
552 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_BLUETOOTH); 554 sub_page = chrome::kBluetoothSubPage;
555 } else {
556 std::string sub_page =
557 std::string(chrome::kDeprecatedOptionsSearchSubPage) + "#" +
558 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_BLUETOOTH);
559 }
553 ShowSettingsSubPageForActiveUser(sub_page); 560 ShowSettingsSubPageForActiveUser(sub_page);
554 } 561 }
555 562
556 void SystemTrayDelegateChromeOS::ToggleBluetooth() { 563 void SystemTrayDelegateChromeOS::ToggleBluetooth() {
557 bluetooth_adapter_->SetPowered(!bluetooth_adapter_->IsPowered(), 564 bluetooth_adapter_->SetPowered(!bluetooth_adapter_->IsPowered(),
558 base::Bind(&base::DoNothing), 565 base::Bind(&base::DoNothing),
559 base::Bind(&base::DoNothing)); 566 base::Bind(&base::DoNothing));
560 } 567 }
561 568
562 bool SystemTrayDelegateChromeOS::GetBluetoothAvailable() { 569 bool SystemTrayDelegateChromeOS::GetBluetoothAvailable() {
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " 1090 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while "
1084 << "ENABLE_SUPERVISED_USERS undefined."; 1091 << "ENABLE_SUPERVISED_USERS undefined.";
1085 return base::string16(); 1092 return base::string16();
1086 } 1093 }
1087 1094
1088 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 1095 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
1089 return new SystemTrayDelegateChromeOS(); 1096 return new SystemTrayDelegateChromeOS();
1090 } 1097 }
1091 1098
1092 } // namespace chromeos 1099 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698