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

Unified Diff: ash/common/wm_shell.cc

Issue 2131733002: mash: Migrate [Keyboard]Brightness code to ash/common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup. Created 4 years, 5 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
Index: ash/common/wm_shell.cc
diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc
index 85613582b8f8acc9d42b5304f93918303b6f013a..e598b6ce5d8f514204c6234faf70216bfab6f380 100644
--- a/ash/common/wm_shell.cc
+++ b/ash/common/wm_shell.cc
@@ -8,7 +8,8 @@
#include "ash/common/keyboard/keyboard_ui.h"
#include "ash/common/shell_delegate.h"
#include "ash/common/shell_window_ids.h"
-#include "ash/common/system/chromeos/session/logout_confirmation_controller.h"
+#include "ash/common/system/brightness_control_delegate.h"
+#include "ash/common/system/keyboard_brightness_control_delegate.h"
#include "ash/common/system/tray/system_tray_delegate.h"
#include "ash/common/system/tray/system_tray_notifier.h"
#include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
@@ -18,6 +19,12 @@
#include "base/bind.h"
#include "base/logging.h"
+#if defined(OS_CHROMEOS)
+#include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h"
+#include "ash/common/system/chromeos/keyboard_brightness_controller.h"
+#include "ash/common/system/chromeos/session/logout_confirmation_controller.h"
+#endif
+
namespace ash {
// static
@@ -58,7 +65,12 @@ WmShell::WmShell(ShellDelegate* delegate)
: delegate_(delegate),
focus_cycler_(new FocusCycler),
system_tray_notifier_(new SystemTrayNotifier),
- window_selector_controller_(new WindowSelectorController()) {}
+ window_selector_controller_(new WindowSelectorController) {
+#if defined(OS_CHROMEOS)
+ brightness_control_delegate_.reset(new system::BrightnessControllerChromeos);
msw 2016/07/08 01:40:48 This seems cleaner than using separate preprocesso
James Cook 2016/07/08 16:29:34 Yeah, I like this better. I hate ifdefs in initial
msw 2016/07/08 17:18:58 Acknowledged.
+ keyboard_brightness_control_delegate_.reset(new KeyboardBrightnessController);
+#endif
+}
WmShell::~WmShell() {}
@@ -82,6 +94,16 @@ bool WmShell::IsSystemModalWindowOpen() {
return false;
}
+void WmShell::SetBrightnessControlDelegate(
+ std::unique_ptr<BrightnessControlDelegate> delegate) {
+ brightness_control_delegate_ = std::move(delegate);
+}
+
+void WmShell::SetKeyboardBrightnessControlDelegate(
+ std::unique_ptr<KeyboardBrightnessControlDelegate> delegate) {
+ keyboard_brightness_control_delegate_ = std::move(delegate);
+}
+
void WmShell::SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui) {
keyboard_ui_ = std::move(keyboard_ui);
}
« ash/common/wm_shell.h ('K') | « ash/common/wm_shell.h ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698