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

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

Issue 2210143003: arc: Handle non-launchable apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit_tests due rebase and mojo param order change - trivial 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (!app_info) { 176 if (!app_info) {
177 VLOG(2) << "Cannot launch unavailable app: " << app_id << "."; 177 VLOG(2) << "Cannot launch unavailable app: " << app_id << ".";
178 return false; 178 return false;
179 } 179 }
180 180
181 if (!app_info->ready) { 181 if (!app_info->ready) {
182 VLOG(2) << "Cannot launch not-ready app: " << app_id << "."; 182 VLOG(2) << "Cannot launch not-ready app: " << app_id << ".";
183 return false; 183 return false;
184 } 184 }
185 185
186 if (!app_info->launchable) {
187 VLOG(2) << "Cannot launch non-launchable app: " << app_id << ".";
188 return false;
189 }
190
186 arc::mojom::AppInstance* app_instance = 191 arc::mojom::AppInstance* app_instance =
187 GetAppInstance(kMinVersion, kLaunchAppStr); 192 GetAppInstance(kMinVersion, kLaunchAppStr);
188 if (!app_instance) 193 if (!app_instance)
189 return false; 194 return false;
190 195
191 if (app_info->shortcut) { 196 if (app_info->shortcut) {
192 app_instance->LaunchIntent(app_info->intent_uri, target_rect); 197 app_instance->LaunchIntent(app_info->intent_uri, target_rect);
193 } else { 198 } else {
194 app_instance->LaunchApp(app_info->package_name, app_info->activity, 199 app_instance->LaunchApp(app_info->package_name, app_info->activity,
195 target_rect); 200 target_rect);
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 if (!app_instance) 326 if (!app_instance)
322 return false; 327 return false;
323 328
324 app_instance->ShowPackageInfoOnPage( 329 app_instance->ShowPackageInfoOnPage(
325 package_name, page, 330 package_name, page,
326 GetTargetRect(gfx::Size(kNexus7Width, kNexus7Height))); 331 GetTargetRect(gfx::Size(kNexus7Width, kNexus7Height)));
327 return true; 332 return true;
328 } 333 }
329 334
330 } // namespace arc 335 } // 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