| 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/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/app_list/app_list_shower_delegate.h" | 10 #include "chrome/browser/ui/app_list/app_list_shower_delegate.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 app_list_->Prerender(); | 94 app_list_->Prerender(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool AppListShower::HasView() const { | 97 bool AppListShower::HasView() const { |
| 98 return !!app_list_; | 98 return !!app_list_; |
| 99 } | 99 } |
| 100 | 100 |
| 101 app_list::AppListView* AppListShower::MakeViewForCurrentProfile() { | 101 app_list::AppListView* AppListShower::MakeViewForCurrentProfile() { |
| 102 // The view delegate will be owned by the app list view. The app list view | 102 // The view delegate will be owned by the app list view. The app list view |
| 103 // manages its own lifetime. | 103 // manages its own lifetime. |
| 104 AppListViewDelegate* view_delegate = new AppListViewDelegate( | 104 AppListViewDelegate* view_delegate = |
| 105 profile_, delegate_->GetControllerDelegateForCreate()); | 105 new AppListViewDelegate(delegate_->GetControllerDelegateForCreate()); |
| 106 view_delegate->SetProfile(profile_); |
| 106 app_list::AppListView* view = new app_list::AppListView(view_delegate); | 107 app_list::AppListView* view = new app_list::AppListView(view_delegate); |
| 107 gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint(); | 108 gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint(); |
| 108 view->InitAsBubbleAtFixedLocation(NULL, | 109 view->InitAsBubbleAtFixedLocation(NULL, |
| 109 0, | 110 0, |
| 110 cursor, | 111 cursor, |
| 111 views::BubbleBorder::FLOAT, | 112 views::BubbleBorder::FLOAT, |
| 112 false /* border_accepts_events */); | 113 false /* border_accepts_events */); |
| 113 return view; | 114 return view; |
| 114 } | 115 } |
| 115 | 116 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 136 FROM_HERE, | 137 FROM_HERE, |
| 137 base::Bind(&AppListShower::ResetKeepAlive, base::Unretained(this))); | 138 base::Bind(&AppListShower::ResetKeepAlive, base::Unretained(this))); |
| 138 return; | 139 return; |
| 139 } | 140 } |
| 140 ResetKeepAlive(); | 141 ResetKeepAlive(); |
| 141 } | 142 } |
| 142 | 143 |
| 143 void AppListShower::ResetKeepAlive() { | 144 void AppListShower::ResetKeepAlive() { |
| 144 keep_alive_.reset(); | 145 keep_alive_.reset(); |
| 145 } | 146 } |
| OLD | NEW |