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

Side by Side Diff: chrome/browser/ui/app_list/arc/arc_app_item.cc

Issue 2540433002: Reland "Propagate information about how ARC apps are launched" (Closed)
Patch Set: Fixed use-after-free Created 4 years 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/arc/arc_app_item.h" 5 #include "chrome/browser/ui/app_list/arc/arc_app_item.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_utils.h" 10 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 ArcAppItem::~ArcAppItem() { 41 ArcAppItem::~ArcAppItem() {
42 } 42 }
43 43
44 const char* ArcAppItem::GetItemType() const { 44 const char* ArcAppItem::GetItemType() const {
45 return ArcAppItem::kItemType; 45 return ArcAppItem::kItemType;
46 } 46 }
47 47
48 void ArcAppItem::Activate(int event_flags) { 48 void ArcAppItem::Activate(int event_flags) {
49 if (!arc::LaunchApp(profile(), id())) 49 if (!arc::LaunchApp(profile(), id(), event_flags))
50 return; 50 return;
51 51
52 // Manually close app_list view because focus is not changed on ARC app start, 52 // Manually close app_list view because focus is not changed on ARC app start,
53 // and current view remains active. 53 // and current view remains active.
54 GetController()->DismissView(); 54 GetController()->DismissView();
55 } 55 }
56 56
57 void ArcAppItem::ExecuteLaunchCommand(int event_flags) { 57 void ArcAppItem::ExecuteLaunchCommand(int event_flags) {
58 Activate(event_flags); 58 Activate(event_flags);
59 } 59 }
(...skipping 11 matching lines...) Expand all
71 UpdateIcon(); 71 UpdateIcon();
72 } 72 }
73 73
74 ui::MenuModel* ArcAppItem::GetContextMenuModel() { 74 ui::MenuModel* ArcAppItem::GetContextMenuModel() {
75 context_menu_.reset(new ArcAppContextMenu(this, 75 context_menu_.reset(new ArcAppContextMenu(this,
76 profile(), 76 profile(),
77 id(), 77 id(),
78 GetController())); 78 GetController()));
79 return context_menu_->GetMenuModel(); 79 return context_menu_->GetMenuModel();
80 } 80 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/browser_options.js ('k') | chrome/browser/ui/app_list/arc/arc_app_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698