summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_init.h
diff options
context:
space:
mode:
authorcpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-09 00:27:42 +0000
committercpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-09 00:27:42 +0000
commit1188a6c0b9025c6ccb9eff833599b951fc778a9a (patch)
tree708039afa2f370b36708d59437db2bb3c706bb36 /chrome/browser/browser_init.h
parent93184db7daf6946d5b61263bc4d0eb7626d67988 (diff)
downloadchromium_src-1188a6c0b9025c6ccb9eff833599b951fc778a9a.zip
chromium_src-1188a6c0b9025c6ccb9eff833599b951fc778a9a.tar.gz
chromium_src-1188a6c0b9025c6ccb9eff833599b951fc778a9a.tar.bz2
Add customized first run tabs
- More refactor of BrowserInit and LaunchWithProfile - hardcoded magic names : new_tab_page and welcome_page BUG=9706 TEST=see the bug for detailed instructions. Review URL: http://codereview.chromium.org/115139 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15701 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_init.h')
-rw-r--r--chrome/browser/browser_init.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/chrome/browser/browser_init.h b/chrome/browser/browser_init.h
index 221f169..fec8990 100644
--- a/chrome/browser/browser_init.h
+++ b/chrome/browser/browser_init.h
@@ -35,7 +35,8 @@ class BrowserInit {
// called during actual process startup.
bool Start(const CommandLine& cmd_line, const std::wstring& cur_dir,
Profile* profile, int* return_code) {
- return ProcessCommandLine(cmd_line, cur_dir, true, profile, return_code);
+ return ProcessCmdLineImpl(cmd_line, cur_dir, true, profile, return_code,
+ this);
}
// This function performs command-line handling and is invoked when
@@ -44,10 +45,13 @@ class BrowserInit {
// line we need to process - either from this process or from some other one
// (if |process_startup| is true and we are being called from
// ProcessSingleton::OnCopyData).
- static bool ProcessCommandLine(const CommandLine& command_line,
+ static bool ProcessCommandLine(const CommandLine& cmd_line,
const std::wstring& cur_dir,
bool process_startup, Profile* profile,
- int* return_code);
+ int* return_code) {
+ return ProcessCmdLineImpl(cmd_line, cur_dir, process_startup, profile,
+ return_code, NULL);
+ }
template <class AutomationProviderClass>
static void CreateAutomationProvider(const std::wstring& channel_id,
@@ -64,8 +68,15 @@ class BrowserInit {
class LaunchWithProfile {
public:
+ // There are two ctors. The first one implies a NULL browser_init object
+ // and thus no access to distribution-specific first-run behaviors. The
+ // second one is always called when the browser starts even if it is not
+ // the first run.
LaunchWithProfile(const std::wstring& cur_dir,
const CommandLine& command_line);
+ LaunchWithProfile(const std::wstring& cur_dir,
+ const CommandLine& command_line,
+ BrowserInit* browser_init);
~LaunchWithProfile() { }
// Creates the necessary windows for startup. Returns true on success,
@@ -118,11 +129,16 @@ class BrowserInit {
std::wstring cur_dir_;
const CommandLine& command_line_;
Profile* profile_;
-
+ BrowserInit* browser_init_;
DISALLOW_COPY_AND_ASSIGN(LaunchWithProfile);
};
private:
+ static bool ProcessCmdLineImpl(const CommandLine& command_line,
+ const std::wstring& cur_dir,
+ bool process_startup, Profile* profile,
+ int* return_code, BrowserInit* browser_init);
+
// Additional tabs to open during first run.
std::vector<GURL> first_run_tabs_;