| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "chrome/browser/ui/app_list/app_list_shower.h" | 7 #include "chrome/browser/ui/app_list/app_list_shower.h" |
| 8 | 8 |
| 9 AppListShower::AppListShower(scoped_ptr<AppListFactory> factory, | 9 AppListShower::AppListShower(scoped_ptr<AppListFactory> factory, |
| 10 scoped_ptr<KeepAliveService> keep_alive) | 10 scoped_ptr<KeepAliveService> keep_alive) |
| 11 : factory_(factory.Pass()), | 11 : factory_(factory.Pass()), |
| 12 keep_alive_service_(keep_alive.Pass()), | 12 keep_alive_service_(keep_alive.Pass()), |
| 13 profile_(NULL), | 13 profile_(NULL), |
| 14 can_close_app_list_(true) { | 14 can_close_app_list_(true) { |
| 15 } | 15 } |
| 16 | 16 |
| 17 AppListShower::~AppListShower() { | 17 AppListShower::~AppListShower() { |
| 18 } | 18 } |
| 19 | 19 |
| 20 void AppListShower::ShowAndReacquireFocus(Profile* requested_profile) { | 20 void AppListShower::ShowAndReacquireFocus(Profile* requested_profile) { |
| 21 ShowForProfile(requested_profile); | 21 ShowForProfile(requested_profile); |
| 22 app_list_->RegainNextLostFocus(); | 22 app_list_->ReactivateOnNextFocusLoss(); |
| 23 } | 23 } |
| 24 | 24 |
| 25 void AppListShower::ShowForProfile(Profile* requested_profile) { | 25 void AppListShower::ShowForProfile(Profile* requested_profile) { |
| 26 // If the app list is already displaying |profile| just activate it (in case | 26 // If the app list is already displaying |profile| just activate it (in case |
| 27 // we have lost focus). | 27 // we have lost focus). |
| 28 if (IsAppListVisible() && (requested_profile == profile_)) { | 28 if (IsAppListVisible() && (requested_profile == profile_)) { |
| 29 app_list_->Show(); | 29 app_list_->Show(); |
| 30 return; | 30 return; |
| 31 } | 31 } |
| 32 | 32 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 void AppListShower::WarmupForProfile(Profile* profile) { | 102 void AppListShower::WarmupForProfile(Profile* profile) { |
| 103 DCHECK(!profile_); | 103 DCHECK(!profile_); |
| 104 CreateViewForProfile(profile); | 104 CreateViewForProfile(profile); |
| 105 app_list_->Prerender(); | 105 app_list_->Prerender(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 bool AppListShower::HasView() const { | 108 bool AppListShower::HasView() const { |
| 109 return !!app_list_; | 109 return !!app_list_; |
| 110 } | 110 } |
| OLD | NEW |