| 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/public/home_card.h" | 5 #include "athena/home/public/home_card.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "athena/common/container_priorities.h" | 9 #include "athena/common/container_priorities.h" |
| 10 #include "athena/home/app_list_view_delegate.h" | 10 #include "athena/home/app_list_view_delegate.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 SetState(VISIBLE_BOTTOM); | 234 SetState(VISIBLE_BOTTOM); |
| 235 } | 235 } |
| 236 | 236 |
| 237 virtual void OnOverviewModeExit() OVERRIDE { | 237 virtual void OnOverviewModeExit() OVERRIDE { |
| 238 SetState(VISIBLE_MINIMIZED); | 238 SetState(VISIBLE_MINIMIZED); |
| 239 } | 239 } |
| 240 | 240 |
| 241 // aura::client::ActivationChangeObserver: | 241 // aura::client::ActivationChangeObserver: |
| 242 virtual void OnWindowActivated(aura::Window* gained_active, | 242 virtual void OnWindowActivated(aura::Window* gained_active, |
| 243 aura::Window* lost_active) OVERRIDE { | 243 aura::Window* lost_active) OVERRIDE { |
| 244 if (gained_active != home_card_widget_->GetNativeWindow()) | 244 if (state_ != HIDDEN && |
| 245 gained_active != home_card_widget_->GetNativeWindow()) { |
| 245 SetState(VISIBLE_MINIMIZED); | 246 SetState(VISIBLE_MINIMIZED); |
| 247 } |
| 246 } | 248 } |
| 247 | 249 |
| 248 scoped_ptr<AppModelBuilder> model_builder_; | 250 scoped_ptr<AppModelBuilder> model_builder_; |
| 249 | 251 |
| 250 HomeCard::State state_; | 252 HomeCard::State state_; |
| 251 | 253 |
| 252 // original_state_ is the state which the home card should go back to after | 254 // original_state_ is the state which the home card should go back to after |
| 253 // the virtual keyboard is hidden. | 255 // the virtual keyboard is hidden. |
| 254 HomeCard::State original_state_; | 256 HomeCard::State original_state_; |
| 255 | 257 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 instance = NULL; | 388 instance = NULL; |
| 387 } | 389 } |
| 388 | 390 |
| 389 // static | 391 // static |
| 390 HomeCard* HomeCard::Get() { | 392 HomeCard* HomeCard::Get() { |
| 391 DCHECK(instance); | 393 DCHECK(instance); |
| 392 return instance; | 394 return instance; |
| 393 } | 395 } |
| 394 | 396 |
| 395 } // namespace athena | 397 } // namespace athena |
| OLD | NEW |