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

Side by Side Diff: trunk/src/apps/app_shim/chrome_main_app_mode_mac.mm

Issue 333403007: Revert 277743 "[Mac] Add interactive App Shim test." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // On Mac, one can't make shortcuts with command-line arguments. Instead, we 5 // On Mac, one can't make shortcuts with command-line arguments. Instead, we
6 // produce small app bundles which locate the Chromium framework and load it, 6 // produce small app bundles which locate the Chromium framework and load it,
7 // passing the appropriate data. This is the entry point into the framework for 7 // passing the appropriate data. This is the entry point into the framework for
8 // those app bundles. 8 // those app bundles.
9 9
10 #import <Cocoa/Cocoa.h> 10 #import <Cocoa/Cocoa.h>
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 runningApplicationsWithBundleIdentifier:chrome_bundle_id]; 604 runningApplicationsWithBundleIdentifier:chrome_bundle_id];
605 if ([existing_chrome count] > 0) 605 if ([existing_chrome count] > 0)
606 pid = [[existing_chrome objectAtIndex:0] processIdentifier]; 606 pid = [[existing_chrome objectAtIndex:0] processIdentifier];
607 } 607 }
608 608
609 AppShimController controller; 609 AppShimController controller;
610 base::MessageLoopForUI main_message_loop; 610 base::MessageLoopForUI main_message_loop;
611 main_message_loop.set_thread_name("MainThread"); 611 main_message_loop.set_thread_name("MainThread");
612 base::PlatformThread::SetName("CrAppShimMain"); 612 base::PlatformThread::SetName("CrAppShimMain");
613 613
614 // In tests, launching Chrome does nothing, and we won't get a ping response, 614 if (pid == -1) {
615 // so just assume the socket exists.
616 if (pid == -1 &&
617 !CommandLine::ForCurrentProcess()->HasSwitch(
618 app_mode::kLaunchedForTest)) {
619 // Launch Chrome if it isn't already running. 615 // Launch Chrome if it isn't already running.
620 ProcessSerialNumber psn; 616 ProcessSerialNumber psn;
621 CommandLine command_line(CommandLine::NO_PROGRAM); 617 CommandLine command_line(CommandLine::NO_PROGRAM);
622 command_line.AppendSwitch(switches::kSilentLaunch); 618 command_line.AppendSwitch(switches::kSilentLaunch);
623 619
624 // If the shim is the app launcher, pass --show-app-list when starting a new 620 // If the shim is the app launcher, pass --show-app-list when starting a new
625 // Chrome process to inform startup codepaths and load the correct profile. 621 // Chrome process to inform startup codepaths and load the correct profile.
626 if (info->app_mode_id == app_mode::kAppListModeId) { 622 if (info->app_mode_id == app_mode::kAppListModeId) {
627 command_line.AppendSwitch(switches::kShowAppList); 623 command_line.AppendSwitch(switches::kShowAppList);
628 } else { 624 } else {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 // minute. 656 // minute.
661 main_message_loop.PostTask( 657 main_message_loop.PostTask(
662 FROM_HERE, 658 FROM_HERE,
663 base::Bind(&AppShimController::Init, 659 base::Bind(&AppShimController::Init,
664 base::Unretained(&controller))); 660 base::Unretained(&controller)));
665 } 661 }
666 662
667 main_message_loop.Run(); 663 main_message_loop.Run();
668 return 0; 664 return 0;
669 } 665 }
OLDNEW
« no previous file with comments | « trunk/src/apps/app_shim/app_shim_interactive_uitest_mac.mm ('k') | trunk/src/chrome/app/app_mode-Info.plist » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698