| OLD | NEW |
| 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 "ash/wm/workspace_controller.h" | 5 #include "ash/wm/workspace_controller.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 // WindowDelegate used by DontCrashOnChangeAndActivate. | 640 // WindowDelegate used by DontCrashOnChangeAndActivate. |
| 641 class DontCrashOnChangeAndActivateDelegate | 641 class DontCrashOnChangeAndActivateDelegate |
| 642 : public aura::test::TestWindowDelegate { | 642 : public aura::test::TestWindowDelegate { |
| 643 public: | 643 public: |
| 644 DontCrashOnChangeAndActivateDelegate() : window_(NULL) {} | 644 DontCrashOnChangeAndActivateDelegate() : window_(NULL) {} |
| 645 | 645 |
| 646 void set_window(aura::Window* window) { window_ = window; } | 646 void set_window(aura::Window* window) { window_ = window; } |
| 647 | 647 |
| 648 // WindowDelegate overrides: | 648 // WindowDelegate overrides: |
| 649 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, | 649 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, |
| 650 const gfx::Rect& new_bounds) OVERRIDE { | 650 const gfx::Rect& new_bounds) override { |
| 651 if (window_) { | 651 if (window_) { |
| 652 wm::ActivateWindow(window_); | 652 wm::ActivateWindow(window_); |
| 653 window_ = NULL; | 653 window_ = NULL; |
| 654 } | 654 } |
| 655 } | 655 } |
| 656 | 656 |
| 657 private: | 657 private: |
| 658 aura::Window* window_; | 658 aura::Window* window_; |
| 659 | 659 |
| 660 DISALLOW_COPY_AND_ASSIGN(DontCrashOnChangeAndActivateDelegate); | 660 DISALLOW_COPY_AND_ASSIGN(DontCrashOnChangeAndActivateDelegate); |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1323 // Number of times OnWindowHierarchyChanged() has been received. | 1323 // Number of times OnWindowHierarchyChanged() has been received. |
| 1324 void clear_change_count() { change_count_ = 0; } | 1324 void clear_change_count() { change_count_ = 0; } |
| 1325 int change_count() const { | 1325 int change_count() const { |
| 1326 return change_count_; | 1326 return change_count_; |
| 1327 } | 1327 } |
| 1328 | 1328 |
| 1329 // aura::WindowObserver overrides: | 1329 // aura::WindowObserver overrides: |
| 1330 // Counts number of times a window is reparented. Ignores reparenting into and | 1330 // Counts number of times a window is reparented. Ignores reparenting into and |
| 1331 // from a docked container which is expected when a tab is dragged. | 1331 // from a docked container which is expected when a tab is dragged. |
| 1332 virtual void OnWindowHierarchyChanged( | 1332 virtual void OnWindowHierarchyChanged( |
| 1333 const HierarchyChangeParams& params) OVERRIDE { | 1333 const HierarchyChangeParams& params) override { |
| 1334 if (params.target != window_ || | 1334 if (params.target != window_ || |
| 1335 (params.old_parent->id() == kShellWindowId_DefaultContainer && | 1335 (params.old_parent->id() == kShellWindowId_DefaultContainer && |
| 1336 params.new_parent->id() == kShellWindowId_DockedContainer) || | 1336 params.new_parent->id() == kShellWindowId_DockedContainer) || |
| 1337 (params.old_parent->id() == kShellWindowId_DockedContainer && | 1337 (params.old_parent->id() == kShellWindowId_DockedContainer && |
| 1338 params.new_parent->id() == kShellWindowId_DefaultContainer)) { | 1338 params.new_parent->id() == kShellWindowId_DefaultContainer)) { |
| 1339 return; | 1339 return; |
| 1340 } | 1340 } |
| 1341 change_count_++; | 1341 change_count_++; |
| 1342 } | 1342 } |
| 1343 | 1343 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1609 ui::EventTimeForNow()); | 1609 ui::EventTimeForNow()); |
| 1610 target = targeter->FindTargetForEvent(root, &touch); | 1610 target = targeter->FindTargetForEvent(root, &touch); |
| 1611 if (points[i].is_target_hit) | 1611 if (points[i].is_target_hit) |
| 1612 EXPECT_EQ(window.get(), target); | 1612 EXPECT_EQ(window.get(), target); |
| 1613 else | 1613 else |
| 1614 EXPECT_NE(window.get(), target); | 1614 EXPECT_NE(window.get(), target); |
| 1615 } | 1615 } |
| 1616 } | 1616 } |
| 1617 | 1617 |
| 1618 } // namespace ash | 1618 } // namespace ash |
| OLD | NEW |