OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/search/arc_app_result.h" | 5 #include "chrome/browser/ui/app_list/search/arc_app_result.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 8 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
9 #include "chrome/browser/ui/app_list/arc/arc_app_context_menu.h" | 9 #include "chrome/browser/ui/app_list/arc/arc_app_context_menu.h" |
10 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h" | 10 #include "chrome/browser/ui/app_list/arc/arc_app_icon_loader.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 RecordHistogram(APP_SEARCH_RESULT); | 48 RecordHistogram(APP_SEARCH_RESULT); |
49 | 49 |
50 if (!arc::LaunchApp(profile(), app_id())) | 50 if (!arc::LaunchApp(profile(), app_id())) |
51 return; | 51 return; |
52 | 52 |
53 // Manually close app_list view because focus is not changed on ARC app start, | 53 // Manually close app_list view because focus is not changed on ARC app start, |
54 // and current view remains active. | 54 // and current view remains active. |
55 controller()->DismissView(); | 55 controller()->DismissView(); |
56 } | 56 } |
57 | 57 |
58 scoped_ptr<SearchResult> ArcAppResult::Duplicate() const { | 58 std::unique_ptr<SearchResult> ArcAppResult::Duplicate() const { |
59 scoped_ptr<SearchResult> copy( | 59 std::unique_ptr<SearchResult> copy( |
60 new ArcAppResult(profile(), app_id(), controller(), | 60 new ArcAppResult(profile(), app_id(), controller(), |
61 display_type() == DISPLAY_RECOMMENDATION)); | 61 display_type() == DISPLAY_RECOMMENDATION)); |
62 copy->set_title(title()); | 62 copy->set_title(title()); |
63 copy->set_title_tags(title_tags()); | 63 copy->set_title_tags(title_tags()); |
64 copy->set_relevance(relevance()); | 64 copy->set_relevance(relevance()); |
65 | 65 |
66 return copy; | 66 return copy; |
67 } | 67 } |
68 | 68 |
69 ui::MenuModel* ArcAppResult::GetContextMenuModel() { | 69 ui::MenuModel* ArcAppResult::GetContextMenuModel() { |
70 if (!context_menu_) { | 70 if (!context_menu_) { |
71 context_menu_.reset(new ArcAppContextMenu( | 71 context_menu_.reset(new ArcAppContextMenu( |
72 this, profile(), app_id(), controller())); | 72 this, profile(), app_id(), controller())); |
73 } | 73 } |
74 | 74 |
75 return context_menu_->GetMenuModel(); | 75 return context_menu_->GetMenuModel(); |
76 } | 76 } |
77 | 77 |
78 } // namespace app_list | 78 } // namespace app_list |
OLD | NEW |