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

Side by Side Diff: ash/wm/workspace/workspace2.cc

Issue 10911256: Change the way the ToplevelEventHandler is hooked up. It is now both a pre- and post-target event h… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/wm/workspace/workspace2.h" 5 #include "ash/wm/workspace/workspace2.h"
6 6
7 #include "ash/shell_window_ids.h" 7 #include "ash/shell_window_ids.h"
8 #include "ash/wm/property_util.h" 8 #include "ash/wm/property_util.h"
9 #include "ash/wm/window_properties.h" 9 #include "ash/wm/window_properties.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 13 matching lines...) Expand all
24 event_handler_(new WorkspaceEventHandler(window_)) { 24 event_handler_(new WorkspaceEventHandler(window_)) {
25 window_->SetProperty(internal::kChildWindowVisibilityChangesAnimatedKey, 25 window_->SetProperty(internal::kChildWindowVisibilityChangesAnimatedKey,
26 true); 26 true);
27 window_->set_id(kShellWindowId_WorkspaceContainer); 27 window_->set_id(kShellWindowId_WorkspaceContainer);
28 window_->SetName("WorkspaceContainer"); 28 window_->SetName("WorkspaceContainer");
29 window_->Init(ui::LAYER_NOT_DRAWN); 29 window_->Init(ui::LAYER_NOT_DRAWN);
30 // Do this so when animating out windows don't extend beyond the bounds. 30 // Do this so when animating out windows don't extend beyond the bounds.
31 window_->layer()->SetMasksToBounds(true); 31 window_->layer()->SetMasksToBounds(true);
32 window_->Hide(); 32 window_->Hide();
33 window_->SetParent(parent); 33 window_->SetParent(parent);
34 window_->AddPreTargetHandler(event_handler_.get());
35 window_->SetProperty(internal::kUsesScreenCoordinatesKey, true); 34 window_->SetProperty(internal::kUsesScreenCoordinatesKey, true);
36 } 35 }
37 36
38 Workspace2::~Workspace2() { 37 Workspace2::~Workspace2() {
39 // ReleaseWindow() should have been invoked before we're deleted. 38 // ReleaseWindow() should have been invoked before we're deleted.
40 DCHECK(!window_); 39 DCHECK(!window_);
41 } 40 }
42 41
43 aura::Window* Workspace2::ReleaseWindow() { 42 aura::Window* Workspace2::ReleaseWindow() {
44 // Remove the LayoutManager and EventFilter as they refer back to us and/or 43 // Remove the LayoutManager and EventFilter as they refer back to us and/or
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 WorkspaceManager2::WillRestoreMaximized(child)) { 75 WorkspaceManager2::WillRestoreMaximized(child)) {
77 if (++count == 2) 76 if (++count == 2)
78 return count; 77 return count;
79 } 78 }
80 } 79 }
81 return count; 80 return count;
82 } 81 }
83 82
84 } // namespace internal 83 } // namespace internal
85 } // namespace ash 84 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698