Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: ash/shell/app_list.cc

Issue 2379863002: Fix object ownership in ui/base/models. (Closed)
Patch Set: fix Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/android/bookmarks/bookmark_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory> 5 #include <memory>
6 #include <string> 6 #include <string>
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
11 #include "ash/common/wm_shell.h" 11 #include "ash/common/wm_shell.h"
12 #include "ash/shell/example_factory.h" 12 #include "ash/shell/example_factory.h"
13 #include "ash/shell/toplevel_window.h" 13 #include "ash/shell/toplevel_window.h"
14 #include "base/callback.h" 14 #include "base/callback.h"
15 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
16 #include "base/i18n/case_conversion.h" 16 #include "base/i18n/case_conversion.h"
17 #include "base/i18n/string_search.h" 17 #include "base/i18n/string_search.h"
18 #include "base/memory/ptr_util.h"
18 #include "base/memory/scoped_vector.h" 19 #include "base/memory/scoped_vector.h"
19 #include "base/strings/string_number_conversions.h" 20 #include "base/strings/string_number_conversions.h"
20 #include "base/strings/string_util.h" 21 #include "base/strings/string_util.h"
21 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
22 #include "ui/app_list/app_list_item.h" 23 #include "ui/app_list/app_list_item.h"
23 #include "ui/app_list/app_list_item_list.h" 24 #include "ui/app_list/app_list_item_list.h"
24 #include "ui/app_list/app_list_model.h" 25 #include "ui/app_list/app_list_model.h"
25 #include "ui/app_list/app_list_view_delegate.h" 26 #include "ui/app_list/app_list_view_delegate.h"
26 #include "ui/app_list/search_box_model.h" 27 #include "ui/app_list/search_box_model.h"
27 #include "ui/app_list/search_result.h" 28 #include "ui/app_list/search_result.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 return; 262 return;
262 263
263 for (int i = 0; i < static_cast<int>(WindowTypeShelfItem::LAST_TYPE); ++i) { 264 for (int i = 0; i < static_cast<int>(WindowTypeShelfItem::LAST_TYPE); ++i) {
264 WindowTypeShelfItem::Type type = 265 WindowTypeShelfItem::Type type =
265 static_cast<WindowTypeShelfItem::Type>(i); 266 static_cast<WindowTypeShelfItem::Type>(i);
266 267
267 base::string16 title = 268 base::string16 title =
268 base::UTF8ToUTF16(WindowTypeShelfItem::GetTitle(type)); 269 base::UTF8ToUTF16(WindowTypeShelfItem::GetTitle(type));
269 if (base::i18n::StringSearchIgnoringCaseAndAccents(query, title, NULL, 270 if (base::i18n::StringSearchIgnoringCaseAndAccents(query, title, NULL,
270 NULL)) { 271 NULL)) {
271 model_->results()->Add(new ExampleSearchResult(type, query)); 272 model_->results()->Add(
273 base::MakeUnique<ExampleSearchResult>(type, query));
272 } 274 }
273 } 275 }
274 } 276 }
275 277
276 void StopSearch() override { 278 void StopSearch() override {
277 // Nothing needs to be done. 279 // Nothing needs to be done.
278 } 280 }
279 281
280 void ViewInitialized() override { 282 void ViewInitialized() override {
281 // Nothing needs to be done. 283 // Nothing needs to be done.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 }; 330 };
329 331
330 } // namespace 332 } // namespace
331 333
332 app_list::AppListViewDelegate* CreateAppListViewDelegate() { 334 app_list::AppListViewDelegate* CreateAppListViewDelegate() {
333 return new ExampleAppListViewDelegate; 335 return new ExampleAppListViewDelegate;
334 } 336 }
335 337
336 } // namespace shell 338 } // namespace shell
337 } // namespace ash 339 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/bookmarks/bookmark_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698