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 29 matching lines...) Expand all Loading... |
40 SetIcon(image); | 40 SetIcon(image); |
41 } | 41 } |
42 | 42 |
43 void ArcAppResult::ExecuteLaunchCommand(int event_flags) { | 43 void ArcAppResult::ExecuteLaunchCommand(int event_flags) { |
44 Open(event_flags); | 44 Open(event_flags); |
45 } | 45 } |
46 | 46 |
47 void ArcAppResult::Open(int event_flags) { | 47 void ArcAppResult::Open(int event_flags) { |
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(), event_flags)) |
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 std::unique_ptr<SearchResult> ArcAppResult::Duplicate() const { | 58 std::unique_ptr<SearchResult> ArcAppResult::Duplicate() const { |
59 std::unique_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 context_menu_.reset(new ArcAppContextMenu( | 70 context_menu_.reset(new ArcAppContextMenu( |
71 this, profile(), app_id(), controller())); | 71 this, profile(), app_id(), controller())); |
72 return context_menu_->GetMenuModel(); | 72 return context_menu_->GetMenuModel(); |
73 } | 73 } |
74 | 74 |
75 } // namespace app_list | 75 } // namespace app_list |
OLD | NEW |