OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/home/home_card_impl.h" | 5 #include "athena/home/home_card_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "athena/common/container_priorities.h" | 10 #include "athena/common/container_priorities.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 if (!home_card_) { | 113 if (!home_card_) { |
114 home_card_ = child; | 114 home_card_ = child; |
115 Layout(false); | 115 Layout(false); |
116 } | 116 } |
117 } | 117 } |
118 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE { | 118 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE { |
119 if (home_card_ == child) | 119 if (home_card_ == child) |
120 home_card_ = NULL; | 120 home_card_ = NULL; |
121 } | 121 } |
122 virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE { | 122 virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE { |
123 Layout(false); | 123 if (!home_card_ || home_card_ == child) |
oshima
2014/09/04 00:23:35
why !home_card_ ? Layout is no-op when it's NULL.
Jun Mukai
2014/09/04 00:31:58
This method can simply be empty instead. Anyways,
mohsen
2014/09/04 14:57:22
Yep, this function is no-op in any case. Removed c
| |
124 Layout(false); | |
124 } | 125 } |
125 virtual void OnChildWindowVisibilityChanged(aura::Window* child, | 126 virtual void OnChildWindowVisibilityChanged(aura::Window* child, |
126 bool visible) OVERRIDE { | 127 bool visible) OVERRIDE { |
127 Layout(false); | 128 if (home_card_ == child) |
129 Layout(false); | |
128 } | 130 } |
129 virtual void SetChildBounds(aura::Window* child, | 131 virtual void SetChildBounds(aura::Window* child, |
130 const gfx::Rect& requested_bounds) OVERRIDE { | 132 const gfx::Rect& requested_bounds) OVERRIDE { |
131 SetChildBoundsDirect(child, requested_bounds); | 133 SetChildBoundsDirect(child, requested_bounds); |
132 } | 134 } |
133 | 135 |
134 aura::Window* home_card_; | 136 aura::Window* home_card_; |
135 ui::Layer* minimized_layer_; | 137 ui::Layer* minimized_layer_; |
136 | 138 |
137 DISALLOW_COPY_AND_ASSIGN(HomeCardLayoutManager); | 139 DISALLOW_COPY_AND_ASSIGN(HomeCardLayoutManager); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
453 instance = NULL; | 455 instance = NULL; |
454 } | 456 } |
455 | 457 |
456 // static | 458 // static |
457 HomeCard* HomeCard::Get() { | 459 HomeCard* HomeCard::Get() { |
458 DCHECK(instance); | 460 DCHECK(instance); |
459 return instance; | 461 return instance; |
460 } | 462 } |
461 | 463 |
462 } // namespace athena | 464 } // namespace athena |
OLD | NEW |