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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 } | 102 } |
103 | 103 |
104 app_list::AppListView* AppListShower::MakeViewForCurrentProfile() { | 104 app_list::AppListView* AppListShower::MakeViewForCurrentProfile() { |
105 // The view delegate will be owned by the app list view. The app list view | 105 // The view delegate will be owned by the app list view. The app list view |
106 // manages its own lifetime. | 106 // manages its own lifetime. |
107 AppListViewDelegate* view_delegate = new AppListViewDelegate( | 107 AppListViewDelegate* view_delegate = new AppListViewDelegate( |
108 profile_, delegate_->GetControllerDelegateForCreate()); | 108 profile_, delegate_->GetControllerDelegateForCreate()); |
109 app_list::AppListView* view = new app_list::AppListView(view_delegate); | 109 app_list::AppListView* view = new app_list::AppListView(view_delegate); |
110 gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint(); | 110 gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint(); |
111 view->InitAsBubbleAtFixedLocation(NULL, | 111 view->InitAsBubbleAtFixedLocation(NULL, |
112 &pagination_model_, | 112 0, |
113 cursor, | 113 cursor, |
114 views::BubbleBorder::FLOAT, | 114 views::BubbleBorder::FLOAT, |
115 false /* border_accepts_events */); | 115 false /* border_accepts_events */); |
116 return view; | 116 return view; |
117 } | 117 } |
118 | 118 |
119 void AppListShower::UpdateViewForNewProfile() { | 119 void AppListShower::UpdateViewForNewProfile() { |
120 app_list_->SetProfileByPath(profile_->GetPath()); | 120 app_list_->SetProfileByPath(profile_->GetPath()); |
121 } | 121 } |
122 | 122 |
123 void AppListShower::Show() { | 123 void AppListShower::Show() { |
124 app_list_->GetWidget()->Show(); | 124 app_list_->GetWidget()->Show(); |
125 if (!window_icon_updated_) { | 125 if (!window_icon_updated_) { |
126 app_list_->GetWidget()->GetTopLevelWidget()->UpdateWindowIcon(); | 126 app_list_->GetWidget()->GetTopLevelWidget()->UpdateWindowIcon(); |
127 window_icon_updated_ = true; | 127 window_icon_updated_ = true; |
128 } | 128 } |
129 app_list_->GetWidget()->Activate(); | 129 app_list_->GetWidget()->Activate(); |
130 } | 130 } |
131 | 131 |
132 void AppListShower::Hide() { | 132 void AppListShower::Hide() { |
133 app_list_->GetWidget()->Hide(); | 133 app_list_->GetWidget()->Hide(); |
134 } | 134 } |
135 | 135 |
136 void AppListShower::ResetKeepAlive() { | 136 void AppListShower::ResetKeepAlive() { |
137 keep_alive_.reset(); | 137 keep_alive_.reset(); |
138 } | 138 } |
OLD | NEW |