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

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: fix another corner case 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 #if defined(OS_WIN)
562 if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
tapted 2013/03/19 02:49:05 I added this -- it's mostly an aesthetic change, b
563 // See if there are apps for this profile that should be launched on startup
564 // due to a switch from Metro mode.
565 apps::HandleAppLaunchForMetroRestart(profile_);
566 }
567 #endif
568
560 if (process_startup && ProcessStartupURLs(urls_to_open)) { 569 if (process_startup && ProcessStartupURLs(urls_to_open)) {
561 // ProcessStartupURLs processed the urls, nothing else to do. 570 // ProcessStartupURLs processed the urls, nothing else to do.
562 return; 571 return;
563 } 572 }
564 573
565 chrome::startup::IsProcessStartup is_process_startup = process_startup ? 574 chrome::startup::IsProcessStartup is_process_startup = process_startup ?
566 chrome::startup::IS_PROCESS_STARTUP : 575 chrome::startup::IS_PROCESS_STARTUP :
567 chrome::startup::IS_NOT_PROCESS_STARTUP; 576 chrome::startup::IS_NOT_PROCESS_STARTUP;
568 if (!process_startup) { 577 if (!process_startup) {
569 // Even if we're not starting a new process, this may conceptually be 578 // 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 } 952 }
944 953
945 #if !defined(OS_WIN) || defined(USE_AURA) 954 #if !defined(OS_WIN) || defined(USE_AURA)
946 // static 955 // static
947 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( 956 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser(
948 Profile* profile, 957 Profile* profile,
949 const std::vector<GURL>& startup_urls) { 958 const std::vector<GURL>& startup_urls) {
950 return false; 959 return false;
951 } 960 }
952 #endif 961 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698