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

Unified Diff: ui/aura/mus/focus_synchronizer.cc

Issue 2577963006: Revert of Converts chrome to aura-mus (Closed)
Patch Set: Created 4 years 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 | « ui/aura/mus/focus_synchronizer.h ('k') | ui/views/mus/desktop_window_tree_host_mus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/focus_synchronizer.cc
diff --git a/ui/aura/mus/focus_synchronizer.cc b/ui/aura/mus/focus_synchronizer.cc
index 74ad3e09c8db15283e45a3f2a3818bd6027788a6..b211315fc9ca0c97d991b01993559d1fe0cd4d51 100644
--- a/ui/aura/mus/focus_synchronizer.cc
+++ b/ui/aura/mus/focus_synchronizer.cc
@@ -16,16 +16,13 @@
FocusSynchronizer::FocusSynchronizer(FocusSynchronizerDelegate* delegate,
ui::mojom::WindowTree* window_tree)
- : delegate_(delegate), window_tree_(window_tree), env_(Env::GetInstance()) {
- DCHECK(env_);
- env_->AddObserver(this);
+ : delegate_(delegate), window_tree_(window_tree) {
+ Env::GetInstance()->AddObserver(this);
}
FocusSynchronizer::~FocusSynchronizer() {
- if (env_) {
- SetActiveFocusClient(nullptr);
- env_->RemoveObserver(this);
- }
+ SetActiveFocusClient(nullptr);
+ Env::GetInstance()->RemoveObserver(this);
}
void FocusSynchronizer::SetFocusFromServer(WindowMus* window) {
@@ -84,13 +81,6 @@
void FocusSynchronizer::OnWindowInitialized(Window* window) {}
-void FocusSynchronizer::OnWillDestroyEnv() {
- // TODO(sky): this override should not be necessary. http://crbug.com/674803.
- SetActiveFocusClient(nullptr);
- env_->RemoveObserver(this);
- env_ = nullptr;
-}
-
void FocusSynchronizer::OnActiveFocusClientChanged(
client::FocusClient* focus_client,
Window* window) {
« no previous file with comments | « ui/aura/mus/focus_synchronizer.h ('k') | ui/views/mus/desktop_window_tree_host_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698