| 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 12 matching lines...) Expand all Loading... |
| 23 profile_(NULL), | 23 profile_(NULL), |
| 24 app_list_(NULL), | 24 app_list_(NULL), |
| 25 window_icon_updated_(false) { | 25 window_icon_updated_(false) { |
| 26 } | 26 } |
| 27 | 27 |
| 28 AppListShower::~AppListShower() { | 28 AppListShower::~AppListShower() { |
| 29 } | 29 } |
| 30 | 30 |
| 31 void AppListShower::ShowForCurrentProfile() { | 31 void AppListShower::ShowForCurrentProfile() { |
| 32 DCHECK(HasView()); | 32 DCHECK(HasView()); |
| 33 keep_alive_.reset(new ScopedKeepAlive(keep_alive::Origin::APP_LIST_SHOWER)); | 33 keep_alive_.reset(new ScopedKeepAlive(keep_alive::Origin::APP_LIST_SHOWER, |
| 34 keep_alive::RestartOption::DISABLED)); |
| 34 | 35 |
| 35 // If the app list is already displaying |profile| just activate it (in case | 36 // If the app list is already displaying |profile| just activate it (in case |
| 36 // we have lost focus). | 37 // we have lost focus). |
| 37 if (!IsAppListVisible()) | 38 if (!IsAppListVisible()) |
| 38 delegate_->MoveNearCursor(app_list_); | 39 delegate_->MoveNearCursor(app_list_); |
| 39 | 40 |
| 40 Show(); | 41 Show(); |
| 41 } | 42 } |
| 42 | 43 |
| 43 gfx::NativeWindow AppListShower::GetWindow() { | 44 gfx::NativeWindow AppListShower::GetWindow() { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 FROM_HERE, | 151 FROM_HERE, |
| 151 base::Bind(&AppListShower::ResetKeepAlive, base::Unretained(this))); | 152 base::Bind(&AppListShower::ResetKeepAlive, base::Unretained(this))); |
| 152 return; | 153 return; |
| 153 } | 154 } |
| 154 ResetKeepAlive(); | 155 ResetKeepAlive(); |
| 155 } | 156 } |
| 156 | 157 |
| 157 void AppListShower::ResetKeepAlive() { | 158 void AppListShower::ResetKeepAlive() { |
| 158 keep_alive_.reset(); | 159 keep_alive_.reset(); |
| 159 } | 160 } |
| OLD | NEW |