diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-03 22:47:10 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-03 22:47:10 +0000 |
commit | f805fe8d565caf479ea438adfd1cd9a0f58b52ab (patch) | |
tree | a61a57f2dfde431a618aaf91517fa49842490278 /chrome/browser/browser_init.h | |
parent | 7bbb2fcc93f8231f1a1e744bd1b57adf4df9a518 (diff) | |
download | chromium_src-f805fe8d565caf479ea438adfd1cd9a0f58b52ab.zip chromium_src-f805fe8d565caf479ea438adfd1cd9a0f58b52ab.tar.gz chromium_src-f805fe8d565caf479ea438adfd1cd9a0f58b52ab.tar.bz2 |
Make BrowserInit use FilePath instead of wstring for current directory.
(A.k.a. shaving a yak to get rid of a FromWStringHack().)
BUG=24672
TEST=builds
Review URL: http://codereview.chromium.org/3064032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54830 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_init.h')
-rw-r--r-- | chrome/browser/browser_init.h | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/chrome/browser/browser_init.h b/chrome/browser/browser_init.h index 496d2e1..c633c97 100644 --- a/chrome/browser/browser_init.h +++ b/chrome/browser/browser_init.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,6 +10,7 @@ #include <vector> #include "base/basictypes.h" +#include "base/file_path.h" #include "base/gtest_prod_util.h" #include "googleurl/src/gurl.h" @@ -40,22 +41,21 @@ class BrowserInit { // This function is equivalent to ProcessCommandLine but should only be // called during actual process startup. - bool Start(const CommandLine& cmd_line, const std::wstring& cur_dir, + bool Start(const CommandLine& cmd_line, const FilePath& cur_dir, Profile* profile, int* return_code) { return ProcessCmdLineImpl(cmd_line, cur_dir, true, profile, return_code, this); } - // This function performs command-line handling and is invoked when - // process starts as well as when we get a start request from another - // process (via the WM_COPYDATA message). |command_line| holds the command - // 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). + // This function performs command-line handling and is invoked when process + // starts as well as when we get a start request from another process (via the + // WM_COPYDATA message). |command_line| holds the command 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& cmd_line, - const std::wstring& cur_dir, - bool process_startup, Profile* profile, - int* return_code) { + const FilePath& cur_dir, bool process_startup, + Profile* profile, int* return_code) { return ProcessCmdLineImpl(cmd_line, cur_dir, process_startup, profile, return_code, NULL); } @@ -68,13 +68,12 @@ class BrowserInit { // Returns true if the browser is coming up. static bool InProcessStartup(); - // Launches a browser window associated with |profile|. |command_line| - // should be the command line passed to this process. |cur_dir| can be - // the null string, which implies that the directory of the executable. - // should be used. |process_startup| indicates whether this is the - // first browser. + // Launches a browser window associated with |profile|. |command_line| should + // be the command line passed to this process. |cur_dir| can be empty, which + // implies that the directory of the executable should be used. + // |process_startup| indicates whether this is the first browser. bool LaunchBrowser(const CommandLine& command_line, Profile* profile, - const std::wstring& cur_dir, bool process_startup, + const FilePath& cur_dir, bool process_startup, int* return_code); // LaunchWithProfile --------------------------------------------------------- @@ -106,12 +105,10 @@ class BrowserInit { // 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, + LaunchWithProfile(const FilePath& cur_dir, const CommandLine& command_line); + LaunchWithProfile(const FilePath& cur_dir, const CommandLine& command_line, BrowserInit* browser_init); - ~LaunchWithProfile() { } + ~LaunchWithProfile(); // Creates the necessary windows for startup. Returns true on success, // false on failure. process_startup is true if Chrome is just @@ -187,7 +184,7 @@ class BrowserInit { // previously instructed not to do so) and warns the user if it is not. void CheckDefaultBrowser(Profile* profile); - std::wstring cur_dir_; + const FilePath cur_dir_; const CommandLine& command_line_; Profile* profile_; BrowserInit* browser_init_; @@ -196,9 +193,9 @@ class BrowserInit { private: static bool ProcessCmdLineImpl(const CommandLine& command_line, - const std::wstring& cur_dir, - bool process_startup, Profile* profile, - int* return_code, BrowserInit* browser_init); + const FilePath& 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_; |