Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_INIT_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_INIT_H_ |
| 6 #define CHROME_BROWSER_UI_BROWSER_INIT_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_INIT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 | 36 |
| 37 BrowserInit(); | 37 BrowserInit(); |
| 38 ~BrowserInit(); | 38 ~BrowserInit(); |
| 39 | 39 |
| 40 // Adds a url to be opened during first run. This overrides the standard | 40 // Adds a url to be opened during first run. This overrides the standard |
| 41 // tabs shown at first run. | 41 // tabs shown at first run. |
| 42 void AddFirstRunTab(const GURL& url); | 42 void AddFirstRunTab(const GURL& url); |
| 43 | 43 |
| 44 // This function is equivalent to ProcessCommandLine but should only be | 44 // This function is equivalent to ProcessCommandLine but should only be |
| 45 // called during actual process startup. | 45 // called during actual process startup. |
| 46 bool Start(const CommandLine& cmd_line, const FilePath& cur_dir, | 46 bool Start(const CommandLine& cmd_line, const FilePath& cur_dir, |
|
Peter Kasting
2012/01/10 02:20:12
Nit: One arg per line on declarations (2 places)
marja
2012/01/10 14:12:03
Done.
| |
| 47 Profile* profile, int* return_code) { | 47 Profile* last_active_profile, |
| 48 return ProcessCmdLineImpl(cmd_line, cur_dir, true, profile, return_code, | 48 const std::vector<Profile*>& other_profiles, int* return_code) { |
|
Peter Kasting
2012/01/10 02:20:12
Nit: I suggest typedefing "std::vector<Profile*>"
marja
2012/01/10 14:12:03
Done.
| |
| 49 this); | 49 return ProcessCmdLineImpl(cmd_line, cur_dir, true, last_active_profile, |
| 50 other_profiles, return_code, this); | |
| 50 } | 51 } |
| 51 | 52 |
| 52 // This function performs command-line handling and is invoked only after | 53 // This function performs command-line handling and is invoked only after |
| 53 // start up (for example when we get a start request for another process). | 54 // start up (for example when we get a start request for another process). |
| 54 // |command_line| holds the command line we need to process | 55 // |command_line| holds the command line we need to process |
| 55 static void ProcessCommandLineAlreadyRunning(const CommandLine& cmd_line, | 56 static void ProcessCommandLineAlreadyRunning(const CommandLine& cmd_line, |
| 56 const FilePath& cur_dir); | 57 const FilePath& cur_dir); |
| 57 | 58 |
| 58 template <class AutomationProviderClass> | 59 template <class AutomationProviderClass> |
| 59 static bool CreateAutomationProvider(const std::string& channel_id, | 60 static bool CreateAutomationProvider(const std::string& channel_id, |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 242 private: | 243 private: |
| 243 // Returns the list of URLs to open from the command line. The returned | 244 // Returns the list of URLs to open from the command line. The returned |
| 244 // vector is empty if the user didn't specify any URLs on the command line. | 245 // vector is empty if the user didn't specify any URLs on the command line. |
| 245 static std::vector<GURL> GetURLsFromCommandLine( | 246 static std::vector<GURL> GetURLsFromCommandLine( |
| 246 const CommandLine& command_line, | 247 const CommandLine& command_line, |
| 247 const FilePath& cur_dir, | 248 const FilePath& cur_dir, |
| 248 Profile* profile); | 249 Profile* profile); |
| 249 | 250 |
| 250 static bool ProcessCmdLineImpl(const CommandLine& command_line, | 251 static bool ProcessCmdLineImpl(const CommandLine& command_line, |
| 251 const FilePath& cur_dir, bool process_startup, | 252 const FilePath& cur_dir, bool process_startup, |
| 252 Profile* profile, int* return_code, | 253 Profile* last_active_profile, |
| 253 BrowserInit* browser_init); | 254 const std::vector<Profile*>& other_profiles, |
| 255 int* return_code, BrowserInit* browser_init); | |
| 254 | 256 |
| 255 // Callback after a profile has been created. | 257 // Callback after a profile has been created. |
| 256 static void ProcessCommandLineOnProfileCreated( | 258 static void ProcessCommandLineOnProfileCreated( |
| 257 const CommandLine& cmd_line, | 259 const CommandLine& cmd_line, |
| 258 const FilePath& cur_dir, | 260 const FilePath& cur_dir, |
| 259 Profile* profile, | 261 Profile* profile, |
| 260 Profile::CreateStatus status); | 262 Profile::CreateStatus status); |
| 261 | 263 |
| 262 // Additional tabs to open during first run. | 264 // Additional tabs to open during first run. |
| 263 std::vector<GURL> first_run_tabs_; | 265 std::vector<GURL> first_run_tabs_; |
| 264 | 266 |
| 265 DISALLOW_COPY_AND_ASSIGN(BrowserInit); | 267 DISALLOW_COPY_AND_ASSIGN(BrowserInit); |
| 266 }; | 268 }; |
| 267 | 269 |
| 268 #endif // CHROME_BROWSER_UI_BROWSER_INIT_H_ | 270 #endif // CHROME_BROWSER_UI_BROWSER_INIT_H_ |
| OLD | NEW |