OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/app_list/app_list_view.h" | 5 #include "ui/app_list/app_list_view.h" |
6 | 6 |
7 #include "ui/app_list/app_list_bubble_border.h" | 7 #include "ui/app_list/app_list_bubble_border.h" |
8 #include "ui/app_list/app_list_item_view.h" | 8 #include "ui/app_list/app_list_item_view.h" |
9 #include "ui/app_list/app_list_model.h" | 9 #include "ui/app_list/app_list_model.h" |
10 #include "ui/app_list/app_list_view_delegate.h" | 10 #include "ui/app_list/app_list_view_delegate.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 bool AppListView::OnKeyPressed(const ui::KeyEvent& event) { | 133 bool AppListView::OnKeyPressed(const ui::KeyEvent& event) { |
134 if (event.key_code() == ui::VKEY_ESCAPE) { | 134 if (event.key_code() == ui::VKEY_ESCAPE) { |
135 Close(); | 135 Close(); |
136 return true; | 136 return true; |
137 } | 137 } |
138 | 138 |
139 return false; | 139 return false; |
140 } | 140 } |
141 | 141 |
142 void AppListView::ButtonPressed(views::Button* sender, | 142 void AppListView::ButtonPressed(views::Button* sender, const ui::Event& event) { |
143 const views::Event& event) { | |
144 if (sender->GetClassName() != AppListItemView::kViewClassName) | 143 if (sender->GetClassName() != AppListItemView::kViewClassName) |
145 return; | 144 return; |
146 | 145 |
147 if (delegate_.get()) { | 146 if (delegate_.get()) { |
148 delegate_->ActivateAppListItem( | 147 delegate_->ActivateAppListItem( |
149 static_cast<AppListItemView*>(sender)->model(), | 148 static_cast<AppListItemView*>(sender)->model(), |
150 event.flags()); | 149 event.flags()); |
151 } | 150 } |
152 Close(); | 151 Close(); |
153 } | 152 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 } | 185 } |
187 } | 186 } |
188 | 187 |
189 void AppListView::OpenResult(const SearchResult& result, int event_flags) { | 188 void AppListView::OpenResult(const SearchResult& result, int event_flags) { |
190 if (delegate_.get()) | 189 if (delegate_.get()) |
191 delegate_->OpenSearchResult(result, event_flags); | 190 delegate_->OpenSearchResult(result, event_flags); |
192 Close(); | 191 Close(); |
193 } | 192 } |
194 | 193 |
195 } // namespace app_list | 194 } // namespace app_list |
OLD | NEW |