OLD | NEW |
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 #ifndef CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ |
6 #define CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ | 6 #define CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // If IsAppLaunch is true and the user set a pref indicating that the app | 94 // If IsAppLaunch is true and the user set a pref indicating that the app |
95 // should open in a tab, do so. | 95 // should open in a tab, do so. |
96 bool OpenApplicationTab(Profile* profile); | 96 bool OpenApplicationTab(Profile* profile); |
97 | 97 |
98 // Invoked from Launch to handle processing of urls. This may do any of the | 98 // Invoked from Launch to handle processing of urls. This may do any of the |
99 // following: | 99 // following: |
100 // . Invoke ProcessStartupURLs if |process_startup| is true. | 100 // . Invoke ProcessStartupURLs if |process_startup| is true. |
101 // . If |process_startup| is false, restore the last session if necessary, | 101 // . If |process_startup| is false, restore the last session if necessary, |
102 // or invoke ProcessSpecifiedURLs. | 102 // or invoke ProcessSpecifiedURLs. |
103 // . Open the urls directly. | 103 // . Open the urls directly. |
104 void ProcessLaunchURLs(bool process_startup, | 104 // Returns the Browser that processed |urls_to_open|. |
105 const std::vector<GURL>& urls_to_open, | 105 Browser* ProcessLaunchURLs(bool process_startup, |
106 chrome::HostDesktopType desktop_type); | 106 const std::vector<GURL>& urls_to_open, |
| 107 chrome::HostDesktopType desktop_type); |
107 | 108 |
108 // Does the following: | 109 // Does the following: |
109 // . If the user's startup pref is to restore the last session (or the | 110 // . If the user's startup pref is to restore the last session (or the |
110 // command line flag is present to force using last session), it is | 111 // command line flag is present to force using last session), it is |
111 // restored. | 112 // restored. |
112 // . Otherwise invoke ProcessSpecifiedURLs | 113 // . Otherwise invoke ProcessSpecifiedURLs |
113 // If a browser was created, true is returned. Otherwise returns false and | 114 // Returns a pointer to a Browser if one was created, otherwise nullptr. |
114 // the caller must create a new browser. | 115 Browser* ProcessStartupURLs(const std::vector<GURL>& urls_to_open, |
115 bool ProcessStartupURLs(const std::vector<GURL>& urls_to_open, | 116 chrome::HostDesktopType desktop_type); |
116 chrome::HostDesktopType desktop_type); | |
117 | 117 |
118 // Invoked from either ProcessLaunchURLs or ProcessStartupURLs to handle | 118 // Invoked from either ProcessLaunchURLs or ProcessStartupURLs to handle |
119 // processing of URLs where the behavior is common between process startup | 119 // processing of URLs where the behavior is common between process startup |
120 // and launch via an existing process (i.e. those explicitly specified by | 120 // and launch via an existing process (i.e. those explicitly specified by |
121 // the user somehow). Does the following: | 121 // the user somehow). Does the following: |
122 // . Attempts to restore any pinned tabs from last run of chrome. | 122 // . Attempts to restore any pinned tabs from last run of chrome. |
123 // . If urls_to_open is non-empty, they are opened. | 123 // . If urls_to_open is non-empty, they are opened. |
124 // . If the user's startup pref is to launch a specific set of URLs they | 124 // . If the user's startup pref is to launch a specific set of URLs they |
125 // are opened. | 125 // are opened. |
126 // | 126 // |
(...skipping 20 matching lines...) Expand all Loading... |
147 | 147 |
148 const base::FilePath cur_dir_; | 148 const base::FilePath cur_dir_; |
149 const base::CommandLine& command_line_; | 149 const base::CommandLine& command_line_; |
150 Profile* profile_; | 150 Profile* profile_; |
151 StartupBrowserCreator* browser_creator_; | 151 StartupBrowserCreator* browser_creator_; |
152 bool is_first_run_; | 152 bool is_first_run_; |
153 DISALLOW_COPY_AND_ASSIGN(StartupBrowserCreatorImpl); | 153 DISALLOW_COPY_AND_ASSIGN(StartupBrowserCreatorImpl); |
154 }; | 154 }; |
155 | 155 |
156 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ | 156 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ |
OLD | NEW |