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

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

Issue 2259033002: Revert of arc: Handle non-launchable apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 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
OLDNEW
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/arc/arc_app_utils.h" 5 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if (!app_info) { 175 if (!app_info) {
176 VLOG(2) << "Cannot launch unavailable app: " << app_id << "."; 176 VLOG(2) << "Cannot launch unavailable app: " << app_id << ".";
177 return false; 177 return false;
178 } 178 }
179 179
180 if (!app_info->ready) { 180 if (!app_info->ready) {
181 VLOG(2) << "Cannot launch not-ready app: " << app_id << "."; 181 VLOG(2) << "Cannot launch not-ready app: " << app_id << ".";
182 return false; 182 return false;
183 } 183 }
184 184
185 if (!app_info->launchable) {
186 VLOG(2) << "Cannot launch non-launchable app: " << app_id << ".";
187 return false;
188 }
189
190 arc::mojom::AppInstance* app_instance = 185 arc::mojom::AppInstance* app_instance =
191 GetAppInstance(kMinVersion, kLaunchAppStr); 186 GetAppInstance(kMinVersion, kLaunchAppStr);
192 if (!app_instance) 187 if (!app_instance)
193 return false; 188 return false;
194 189
195 if (app_info->shortcut) { 190 if (app_info->shortcut) {
196 app_instance->LaunchIntent(app_info->intent_uri, target_rect); 191 app_instance->LaunchIntent(app_info->intent_uri, target_rect);
197 } else { 192 } else {
198 app_instance->LaunchApp(app_info->package_name, app_info->activity, 193 app_instance->LaunchApp(app_info->package_name, app_info->activity,
199 target_rect); 194 target_rect);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 if (!app_instance) 295 if (!app_instance)
301 return false; 296 return false;
302 297
303 app_instance->ShowPackageInfoOnPage( 298 app_instance->ShowPackageInfoOnPage(
304 package_name, page, 299 package_name, page,
305 GetTargetRect(gfx::Size(kNexus7Width, kNexus7Height))); 300 GetTargetRect(gfx::Size(kNexus7Width, kNexus7Height)));
306 return true; 301 return true;
307 } 302 }
308 303
309 } // namespace arc 304 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_unittest.cc ('k') | chrome/browser/ui/ash/launcher/arc_launcher_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698