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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 1412863004: arc-bridge: Add the ARC Bridge Service (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | chromeos/arc/OWNERS » ('j') | chromeos/arc/bridge/DEPS » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/startup/startup_browser_creator_impl.h" 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "apps/app_restore_service.h" 10 #include "apps/app_restore_service.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 #if defined(OS_WIN) 107 #if defined(OS_WIN)
108 #include "base/win/windows_version.h" 108 #include "base/win/windows_version.h"
109 #include "chrome/browser/apps/app_launch_for_metro_restart_win.h" 109 #include "chrome/browser/apps/app_launch_for_metro_restart_win.h"
110 #endif 110 #endif
111 111
112 #if defined(ENABLE_RLZ) 112 #if defined(ENABLE_RLZ)
113 #include "components/rlz/rlz_tracker.h" 113 #include "components/rlz/rlz_tracker.h"
114 #endif 114 #endif
115 115
116 #if defined(OS_CHROMEOS)
117 #include "chromeos/arc/bridge/arc_bridge_service.h"
118 #include "chromeos/arc/bridge/arc_bridge_service_factory.h"
119 #endif
120
116 using content::ChildProcessSecurityPolicy; 121 using content::ChildProcessSecurityPolicy;
117 using content::WebContents; 122 using content::WebContents;
118 using extensions::Extension; 123 using extensions::Extension;
119 124
120 namespace { 125 namespace {
121 126
122 // Utility functions ---------------------------------------------------------- 127 // Utility functions ----------------------------------------------------------
123 128
124 enum LaunchMode { 129 enum LaunchMode {
125 LM_TO_BE_DECIDED = 0, // Possibly direct launch or via a shortcut. 130 LM_TO_BE_DECIDED = 0, // Possibly direct launch or via a shortcut.
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 else if (pref.type == SessionStartupPref::DEFAULT) 590 else if (pref.type == SessionStartupPref::DEFAULT)
586 VLOG(1) << "Pref: default"; 591 VLOG(1) << "Pref: default";
587 592
588 apps::AppRestoreService* restore_service = 593 apps::AppRestoreService* restore_service =
589 apps::AppRestoreServiceFactory::GetForProfile(profile_); 594 apps::AppRestoreServiceFactory::GetForProfile(profile_);
590 // NULL in incognito mode. 595 // NULL in incognito mode.
591 if (restore_service) { 596 if (restore_service) {
592 restore_service->HandleStartup(apps::AppRestoreService::ShouldRestoreApps( 597 restore_service->HandleStartup(apps::AppRestoreService::ShouldRestoreApps(
593 StartupBrowserCreator::WasRestarted())); 598 StartupBrowserCreator::WasRestarted()));
594 } 599 }
600 #if defined(OS_CHROMEOS)
601 // In Chrome OS let's try to restore the ARC instance if it is available.
602 arc::ArcBridgeService* arc_bridge_service =
603 arc::ArcBridgeServiceFactory::GetForProfile(profile_);
604 if (arc_bridge_service) {
605 arc_bridge_service->HandleStartup();
606 }
607 #endif
satorux1 2015/10/23 06:10:58 I'm not sure if this is the right place. Let's ask
Luis Héctor Chávez 2015/10/27 00:37:47 Ack. He expressed that this is an okay place.
595 608
596 if (pref.type == SessionStartupPref::LAST) { 609 if (pref.type == SessionStartupPref::LAST) {
597 if (profile_->GetLastSessionExitType() == Profile::EXIT_CRASHED && 610 if (profile_->GetLastSessionExitType() == Profile::EXIT_CRASHED &&
598 !command_line_.HasSwitch(switches::kRestoreLastSession)) { 611 !command_line_.HasSwitch(switches::kRestoreLastSession)) {
599 // The last session crashed. It's possible automatically loading the 612 // The last session crashed. It's possible automatically loading the
600 // page will trigger another crash, locking the user out of chrome. 613 // page will trigger another crash, locking the user out of chrome.
601 // To avoid this, don't restore on startup but instead show the crashed 614 // To avoid this, don't restore on startup but instead show the crashed
602 // infobar. 615 // infobar.
603 VLOG(1) << "Unclean exit; not processing"; 616 VLOG(1) << "Unclean exit; not processing";
604 return false; 617 return false;
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 TriggeredProfileResetter* triggered_profile_resetter = 1016 TriggeredProfileResetter* triggered_profile_resetter =
1004 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); 1017 TriggeredProfileResetterFactory::GetForBrowserContext(profile_);
1005 // TriggeredProfileResetter instance will be nullptr for incognito profiles. 1018 // TriggeredProfileResetter instance will be nullptr for incognito profiles.
1006 if (triggered_profile_resetter) { 1019 if (triggered_profile_resetter) {
1007 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); 1020 has_reset_trigger = triggered_profile_resetter->HasResetTrigger();
1008 triggered_profile_resetter->ClearResetTrigger(); 1021 triggered_profile_resetter->ClearResetTrigger();
1009 } 1022 }
1010 #endif // defined(OS_WIN) 1023 #endif // defined(OS_WIN)
1011 return has_reset_trigger; 1024 return has_reset_trigger;
1012 } 1025 }
OLDNEW
« no previous file with comments | « no previous file | chromeos/arc/OWNERS » ('j') | chromeos/arc/bridge/DEPS » ('J')

Powered by Google App Engine
This is Rietveld 408576698