OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_BROWSER_INIT_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_INIT_H_ |
6 #define CHROME_BROWSER_BROWSER_INIT_H_ | 6 #define CHROME_BROWSER_BROWSER_INIT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // If the process was launched with the web application command line flags, | 135 // If the process was launched with the web application command line flags, |
136 // e.g. --app=http://www.google.com/ or --app_id=... return true. | 136 // e.g. --app=http://www.google.com/ or --app_id=... return true. |
137 // In this case |app_url| or |app_id| are populated if they're non-null. | 137 // In this case |app_url| or |app_id| are populated if they're non-null. |
138 bool IsAppLaunch(std::string* app_url, std::string* app_id); | 138 bool IsAppLaunch(std::string* app_url, std::string* app_id); |
139 | 139 |
140 // If IsAppLaunch is true, tries to open an application window. | 140 // If IsAppLaunch is true, tries to open an application window. |
141 // If the app is specified to start in a tab, or IsAppLaunch is false, | 141 // If the app is specified to start in a tab, or IsAppLaunch is false, |
142 // returns false to specify default processing. | 142 // returns false to specify default processing. |
143 bool OpenApplicationWindow(Profile* profile); | 143 bool OpenApplicationWindow(Profile* profile); |
144 | 144 |
| 145 // Invoked from OpenURLsInBrowser to handle processing of urls. This may |
| 146 // do any of the following: |
| 147 // . Invoke ProcessStartupURLs if |process_startup| is true. |
| 148 // . Restore the last session if necessary. |
| 149 // . Open the urls directly. |
| 150 void ProcessLaunchURLs(bool process_startup, |
| 151 const std::vector<GURL>& urls_to_open); |
| 152 |
145 // Does the following: | 153 // Does the following: |
146 // . If the user's startup pref is to restore the last session (or the | 154 // . If the user's startup pref is to restore the last session (or the |
147 // command line flag is present to force using last session), it is | 155 // command line flag is present to force using last session), it is |
148 // restored, and true is returned. | 156 // restored, and true is returned. |
149 // . Attempts to restore any pinned tabs from last run of chrome and: | 157 // . Attempts to restore any pinned tabs from last run of chrome and: |
150 // . If urls_to_open is non-empty, they are opened and true is returned. | 158 // . If urls_to_open is non-empty, they are opened and true is returned. |
151 // . If the user's startup pref is to launch a specific set of URLs they | 159 // . If the user's startup pref is to launch a specific set of URLs they |
152 // are opened. | 160 // are opened. |
153 // | 161 // |
154 // Otherwise false is returned, which indicates the caller must create a | 162 // Otherwise false is returned, which indicates the caller must create a |
155 // new browser. | 163 // new browser. |
156 bool OpenStartupURLs(const std::vector<GURL>& urls_to_open); | 164 bool ProcessStartupURLs(const std::vector<GURL>& urls_to_open); |
157 | 165 |
158 // If the last session didn't exit cleanly and tab is a web contents tab, | 166 // If the last session didn't exit cleanly and tab is a web contents tab, |
159 // an infobar is added allowing the user to restore the last session. | 167 // an infobar is added allowing the user to restore the last session. |
160 void AddCrashedInfoBarIfNecessary(TabContents* tab); | 168 void AddCrashedInfoBarIfNecessary(TabContents* tab); |
161 | 169 |
162 // Returns the list of URLs to open from the command line. The returned | 170 // Returns the list of URLs to open from the command line. The returned |
163 // vector is empty if the user didn't specify any URLs on the command line. | 171 // vector is empty if the user didn't specify any URLs on the command line. |
164 std::vector<GURL> GetURLsFromCommandLine(Profile* profile); | 172 std::vector<GURL> GetURLsFromCommandLine(Profile* profile); |
165 | 173 |
166 // Adds additional startup URLs to the specified vector. | 174 // Adds additional startup URLs to the specified vector. |
(...skipping 16 matching lines...) Expand all Loading... |
183 bool process_startup, Profile* profile, | 191 bool process_startup, Profile* profile, |
184 int* return_code, BrowserInit* browser_init); | 192 int* return_code, BrowserInit* browser_init); |
185 | 193 |
186 // Additional tabs to open during first run. | 194 // Additional tabs to open during first run. |
187 std::vector<GURL> first_run_tabs_; | 195 std::vector<GURL> first_run_tabs_; |
188 | 196 |
189 DISALLOW_COPY_AND_ASSIGN(BrowserInit); | 197 DISALLOW_COPY_AND_ASSIGN(BrowserInit); |
190 }; | 198 }; |
191 | 199 |
192 #endif // CHROME_BROWSER_BROWSER_INIT_H_ | 200 #endif // CHROME_BROWSER_BROWSER_INIT_H_ |
OLD | NEW |