summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-15 01:37:31 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-15 01:37:31 +0000
commit880d489c99d671e440e5a7aecd6b69a7b3de57fe (patch)
tree8f3f16a29d28b896fb3727fbaad66e98429efa8f /chrome
parentd2fc65d334aedeac55c9a439ae8e677e59894f52 (diff)
downloadchromium_src-880d489c99d671e440e5a7aecd6b69a7b3de57fe.zip
chromium_src-880d489c99d671e440e5a7aecd6b69a7b3de57fe.tar.gz
chromium_src-880d489c99d671e440e5a7aecd6b69a7b3de57fe.tar.bz2
Couple of changes for chrome os startup:
. Adds command line option specifying some tabs should be pinned on startup. . Disables crash dialog on startup. . Disables linux warning page on startup. BUG=none TEST=none Review URL: http://codereview.chromium.org/149641 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20708 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser_init.cc17
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h2
3 files changed, 22 insertions, 1 deletions
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc
index 3f3906f..d3062ef 100644
--- a/chrome/browser/browser_init.cc
+++ b/chrome/browser/browser_init.cc
@@ -436,7 +436,7 @@ bool BrowserInit::LaunchWithProfile::Launch(Profile* profile,
browser = BrowserList::GetLastActive();
OpenURLsInBrowser(browser, process_startup, urls_to_open);
}
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
// TODO(port): Remove ifdef when the Linux splash page is not needed.
const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
// This can mess up UI tests, so only do it when UI tests aren't running.
@@ -549,12 +549,21 @@ Browser* BrowserInit::LaunchWithProfile::OpenURLsInBrowser(
bool process_startup,
const std::vector<GURL>& urls) {
DCHECK(!urls.empty());
+ int pin_count = 0;
+ if (!browser) {
+ std::wstring pin_count_string =
+ command_line_.GetSwitchValue(switches::kPinnedTabCount);
+ if (!pin_count_string.empty())
+ pin_count = StringToInt(WideToUTF16Hack(pin_count_string));
+ }
if (!browser || browser->type() != Browser::TYPE_NORMAL)
browser = Browser::Create(profile_);
for (size_t i = 0; i < urls.size(); ++i) {
TabContents* tab = browser->AddTabWithURL(
urls[i], GURL(), PageTransition::START_PAGE, (i == 0), -1, false, NULL);
+ if (i < static_cast<size_t>(pin_count))
+ browser->tabstrip_model()->SetTabPinned(browser->tab_count() - 1, true);
if (i == 0 && process_startup)
AddCrashedInfoBarIfNecessary(tab);
}
@@ -568,6 +577,11 @@ Browser* BrowserInit::LaunchWithProfile::OpenURLsInBrowser(
void BrowserInit::LaunchWithProfile::AddCrashedInfoBarIfNecessary(
TabContents* tab) {
+#if defined(OS_CHROMEOS)
+ // Because of how chrome os currently shuts down chrome always appears to
+ // crash. For the time being we're working around that here.
+ return;
+#else
// Assume that if the user is launching incognito they were previously
// running incognito so that we have nothing to restore from.
if (!profile_->DidLastSessionExitCleanly() &&
@@ -577,6 +591,7 @@ void BrowserInit::LaunchWithProfile::AddCrashedInfoBarIfNecessary(
// it is closed.
tab->AddInfoBar(new SessionCrashedInfoBarDelegate(tab));
}
+#endif
}
std::vector<GURL> BrowserInit::LaunchWithProfile::GetURLsFromCommandLine(
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index d289c89..c3a7770 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -547,4 +547,8 @@ const wchar_t kRendererCrashDump[] = L"renderer-crash-dumping";
// Enables the new Tabstrip on Windows.
const wchar_t kEnableTabtastic2[] = L"enable-tabtastic2";
+// Number of tabs to pin on startup. This is not use if session restore is
+// enabled.
+const wchar_t kPinnedTabCount[] = L"pinned-tab-count";
+
} // namespace switches
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 385d1ec..135b148 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -209,6 +209,8 @@ extern const wchar_t kRendererCrashDump[];
extern const wchar_t kEnableTabtastic2[];
+extern const wchar_t kPinnedTabCount[];
+
} // namespace switches
#endif // CHROME_COMMON_CHROME_SWITCHES_H_