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

Unified Diff: athena/env/athena_env_impl.cc

Issue 693643004: Make UserActivityDetector a singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@athena_do_not_use_ash45
Patch Set: Created 6 years, 2 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: athena/env/athena_env_impl.cc
diff --git a/athena/env/athena_env_impl.cc b/athena/env/athena_env_impl.cc
index 326b950cc567c1ca9abecd5095db12aa67c42ef9..bdb6408fea58523d4bb4a6ca13a0157356920168 100644
--- a/athena/env/athena_env_impl.cc
+++ b/athena/env/athena_env_impl.cc
@@ -197,11 +197,10 @@ class AthenaEnvImpl : public AthenaEnv,
cursor_manager_->SetCursor(ui::kCursorPointer);
aura::client::SetCursorClient(host_->window(), cursor_manager_.get());
- user_activity_detector_.reset(new wm::UserActivityDetector);
host_->event_processor()->GetRootTarget()->AddPreTargetHandler(
- user_activity_detector_.get());
+ wm::UserActivityDetector::Get());
user_activity_notifier_.reset(new ui::UserActivityPowerManagerNotifier(
- user_activity_detector_.get()));
+ wm::UserActivityDetector::Get()));
host_->AddObserver(this);
host_->Show();
@@ -216,16 +215,13 @@ class AthenaEnvImpl : public AthenaEnv,
host_->RemoveObserver(this);
if (input_method_filter_)
root_window_event_filter_->RemoveHandler(input_method_filter_.get());
- if (user_activity_detector_) {
- host_->event_processor()->GetRootTarget()->RemovePreTargetHandler(
- user_activity_detector_.get());
- }
+ host_->event_processor()->GetRootTarget()->RemovePreTargetHandler(
+ wm::UserActivityDetector::Get());
root_window_event_filter_.reset();
capture_client_.reset();
input_method_filter_.reset();
cursor_manager_.reset();
user_activity_notifier_.reset();
- user_activity_detector_.reset();
input_method_filter_.reset();
host_.reset();
@@ -313,7 +309,6 @@ class AthenaEnvImpl : public AthenaEnv,
scoped_ptr<wm::CompoundEventFilter> root_window_event_filter_;
scoped_ptr<aura::client::DefaultCaptureClient> capture_client_;
scoped_ptr<wm::CursorManager> cursor_manager_;
- scoped_ptr<wm::UserActivityDetector> user_activity_detector_;
scoped_ptr<ui::DisplayConfigurator> display_configurator_;
scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;

Powered by Google App Engine
This is Rietveld 408576698