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

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

Issue 12450014: Show an InfoBar when trying to start Packaged Apps from Metro mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 7 years, 9 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 (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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 #if defined(OS_MACOSX) 94 #if defined(OS_MACOSX)
95 #include "base/mac/mac_util.h" 95 #include "base/mac/mac_util.h"
96 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" 96 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h"
97 #endif 97 #endif
98 98
99 #if defined(TOOLKIT_GTK) 99 #if defined(TOOLKIT_GTK)
100 #include "chrome/browser/ui/gtk/gtk_util.h" 100 #include "chrome/browser/ui/gtk/gtk_util.h"
101 #endif 101 #endif
102 102
103 #if defined(OS_WIN) 103 #if defined(OS_WIN)
104 #include "apps/app_launch_for_metro_restart_win.h"
104 #include "base/win/windows_version.h" 105 #include "base/win/windows_version.h"
105 #endif 106 #endif
106 107
107 using content::ChildProcessSecurityPolicy; 108 using content::ChildProcessSecurityPolicy;
108 using content::WebContents; 109 using content::WebContents;
109 using extensions::Extension; 110 using extensions::Extension;
110 111
111 namespace { 112 namespace {
112 113
113 // Utility functions ---------------------------------------------------------- 114 // Utility functions ----------------------------------------------------------
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 const std::vector<GURL>& urls_to_open) { 551 const std::vector<GURL>& urls_to_open) {
551 // If we're starting up in "background mode" (no open browser window) then 552 // If we're starting up in "background mode" (no open browser window) then
552 // don't open any browser windows, unless kAutoLaunchAtStartup is also 553 // don't open any browser windows, unless kAutoLaunchAtStartup is also
553 // specified. 554 // specified.
554 if (process_startup && 555 if (process_startup &&
555 command_line_.HasSwitch(switches::kNoStartupWindow) && 556 command_line_.HasSwitch(switches::kNoStartupWindow) &&
556 !command_line_.HasSwitch(switches::kAutoLaunchAtStartup)) { 557 !command_line_.HasSwitch(switches::kAutoLaunchAtStartup)) {
557 return; 558 return;
558 } 559 }
559 560
561 // TODO(tapted): Move this to startup_browser_creator_win.cc after refactor.
562 #if defined(OS_WIN)
563 if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
564 // See if there are apps for this profile that should be launched on startup
565 // due to a switch from Metro mode.
566 apps::HandleAppLaunchForMetroRestart(profile_);
567 }
568 #endif
569
560 if (process_startup && ProcessStartupURLs(urls_to_open)) { 570 if (process_startup && ProcessStartupURLs(urls_to_open)) {
561 // ProcessStartupURLs processed the urls, nothing else to do. 571 // ProcessStartupURLs processed the urls, nothing else to do.
562 return; 572 return;
563 } 573 }
564 574
565 chrome::startup::IsProcessStartup is_process_startup = process_startup ? 575 chrome::startup::IsProcessStartup is_process_startup = process_startup ?
566 chrome::startup::IS_PROCESS_STARTUP : 576 chrome::startup::IS_PROCESS_STARTUP :
567 chrome::startup::IS_NOT_PROCESS_STARTUP; 577 chrome::startup::IS_NOT_PROCESS_STARTUP;
568 if (!process_startup) { 578 if (!process_startup) {
569 // Even if we're not starting a new process, this may conceptually be 579 // Even if we're not starting a new process, this may conceptually be
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 } 953 }
944 954
945 #if !defined(OS_WIN) || defined(USE_AURA) 955 #if !defined(OS_WIN) || defined(USE_AURA)
946 // static 956 // static
947 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( 957 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser(
948 Profile* profile, 958 Profile* profile,
949 const std::vector<GURL>& startup_urls) { 959 const std::vector<GURL>& startup_urls) {
950 return false; 960 return false;
951 } 961 }
952 #endif 962 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698