| 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 "chrome/browser/ui/app_list/app_list_shower_views.h" | 5 #include "chrome/browser/ui/app_list/app_list_shower_views.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/profiler/scoped_tracker.h" | 9 #include "base/profiler/scoped_tracker.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // correctly been destroyed before ending the keep alive so that | 91 // correctly been destroyed before ending the keep alive so that |
| 92 // CloseAllSecondaryWidgets() won't attempt to delete the AppList's Widget | 92 // CloseAllSecondaryWidgets() won't attempt to delete the AppList's Widget |
| 93 // again. | 93 // again. |
| 94 ResetKeepAliveSoon(); | 94 ResetKeepAliveSoon(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool AppListShower::IsAppListVisible() const { | 97 bool AppListShower::IsAppListVisible() const { |
| 98 return app_list_ && app_list_->GetWidget()->IsVisible(); | 98 return app_list_ && app_list_->GetWidget()->IsVisible(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void AppListShower::WarmupForProfile(Profile* profile) { | |
| 102 DCHECK(!profile_); | |
| 103 CreateViewForProfile(profile); | |
| 104 app_list_->Prerender(); | |
| 105 } | |
| 106 | |
| 107 bool AppListShower::HasView() const { | 101 bool AppListShower::HasView() const { |
| 108 return !!app_list_; | 102 return !!app_list_; |
| 109 } | 103 } |
| 110 | 104 |
| 111 app_list::AppListView* AppListShower::MakeViewForCurrentProfile() { | 105 app_list::AppListView* AppListShower::MakeViewForCurrentProfile() { |
| 112 app_list::AppListView* view; | 106 app_list::AppListView* view; |
| 113 { | 107 { |
| 114 // TODO(tapted): Remove ScopedTracker below once crbug.com/431326 is fixed. | 108 // TODO(tapted): Remove ScopedTracker below once crbug.com/431326 is fixed. |
| 115 tracked_objects::ScopedTracker tracking_profile1( | 109 tracked_objects::ScopedTracker tracking_profile1( |
| 116 FROM_HERE_WITH_EXPLICIT_FUNCTION("431326 AppListView()")); | 110 FROM_HERE_WITH_EXPLICIT_FUNCTION("431326 AppListView()")); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 FROM_HERE, | 145 FROM_HERE, |
| 152 base::Bind(&AppListShower::ResetKeepAlive, base::Unretained(this))); | 146 base::Bind(&AppListShower::ResetKeepAlive, base::Unretained(this))); |
| 153 return; | 147 return; |
| 154 } | 148 } |
| 155 ResetKeepAlive(); | 149 ResetKeepAlive(); |
| 156 } | 150 } |
| 157 | 151 |
| 158 void AppListShower::ResetKeepAlive() { | 152 void AppListShower::ResetKeepAlive() { |
| 159 keep_alive_.reset(); | 153 keep_alive_.reset(); |
| 160 } | 154 } |
| OLD | NEW |