diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-28 19:14:33 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-28 19:14:33 +0000 |
commit | d3038bf0175f75df75385a17298134a2ee39b8a1 (patch) | |
tree | eb795e71e50dfc7bb5f791af24e5d85b0abe54ac /chrome/browser/sessions | |
parent | db921de9330f6245dc93cf1529c8c180e74d1ae8 (diff) | |
download | chromium_src-d3038bf0175f75df75385a17298134a2ee39b8a1.zip chromium_src-d3038bf0175f75df75385a17298134a2ee39b8a1.tar.gz chromium_src-d3038bf0175f75df75385a17298134a2ee39b8a1.tar.bz2 |
Disables pinned tabs until I land apps. I've #ifdef parts that are
going to stay around, but need to be disabled for now.
BUG=32845
TEST=make sure pinned tabs are disabled for now.
Review URL: http://codereview.chromium.org/557026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37421 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions')
-rw-r--r-- | chrome/browser/sessions/session_restore.cc | 26 | ||||
-rw-r--r-- | chrome/browser/sessions/session_service.cc | 2 | ||||
-rw-r--r-- | chrome/browser/sessions/session_service_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/sessions/tab_restore_service_unittest.cc | 2 |
4 files changed, 11 insertions, 23 deletions
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc index b549b04..f450013 100644 --- a/chrome/browser/sessions/session_restore.cc +++ b/chrome/browser/sessions/session_restore.cc @@ -228,16 +228,13 @@ class SessionRestoreImpl : public NotificationObserver { void FinishedTabCreation(bool succeeded, bool created_tabbed_browser) { if (!created_tabbed_browser && always_create_tabbed_browser_) { Browser* browser = Browser::Create(profile_); - // Honor --pinned-tab-count if we're synchronous (which means we're run - // during startup) and the user specified urls on the command line. - bool honor_pin_tabs = synchronous_ && !urls_to_open_.empty(); if (urls_to_open_.empty()) { // No tab browsers were created and no URLs were supplied on the command // line. Add an empty URL, which is treated as opening the users home // page. urls_to_open_.push_back(GURL()); } - AppendURLsToBrowser(browser, urls_to_open_, honor_pin_tabs); + AppendURLsToBrowser(browser, urls_to_open_); browser->window()->Show(); } @@ -321,7 +318,7 @@ class SessionRestoreImpl : public NotificationObserver { current_browser->CloseAllTabs(); } if (last_browser && !urls_to_open_.empty()) - AppendURLsToBrowser(last_browser, urls_to_open_, false); + AppendURLsToBrowser(last_browser, urls_to_open_); // If last_browser is NULL and urls_to_open_ is non-empty, // FinishedTabCreation will create a new TabbedBrowser and add the urls to // it. @@ -368,27 +365,12 @@ class SessionRestoreImpl : public NotificationObserver { browser->GetSelectedTabContents()->view()->SetInitialFocus(); } - // Appends the urls in |urls| to |browser|. If |pin_tabs| is true the first n - // tabs are pinned, where n is the command line value for --pinned-tab-count. + // Appends the urls in |urls| to |browser|. void AppendURLsToBrowser(Browser* browser, - const std::vector<GURL>& urls, - bool pin_tabs) { - int pin_count = 0; - if (pin_tabs) { - std::string pin_count_string = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - switches::kPinnedTabCount); - if (!pin_count_string.empty()) - pin_count = StringToInt(pin_count_string); - } - + const std::vector<GURL>& urls) { for (size_t i = 0; i < urls.size(); ++i) { 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); - } } } diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc index b52ee01..5833675 100644 --- a/chrome/browser/sessions/session_service.cc +++ b/chrome/browser/sessions/session_service.cc @@ -910,7 +910,9 @@ bool SessionService::CreateTabsAndWindows( PinnedStatePayload payload; if (!command->GetPayload(&payload, sizeof(payload))) return true; +#if defined(ENABLE_PINNED_TABS) GetTab(payload.tab_id, tabs)->pinned = payload.pinned_state; +#endif break; } diff --git a/chrome/browser/sessions/session_service_unittest.cc b/chrome/browser/sessions/session_service_unittest.cc index 1fec7f3..25fc8ad 100644 --- a/chrome/browser/sessions/session_service_unittest.cc +++ b/chrome/browser/sessions/session_service_unittest.cc @@ -553,7 +553,9 @@ TEST_F(SessionServiceTest, PinnedFalseWhenSetToFalse) { EXPECT_FALSE(CreateAndWriteSessionWithOneTab(false, true)); } -// Explicitly set the pinned state to false and make sure we get back true. +#if defined(ENABLE_PINNED_TABS) +// Explicitly set the pinned state to true and make sure we get back true. TEST_F(SessionServiceTest, PinnedTrue) { EXPECT_TRUE(CreateAndWriteSessionWithOneTab(true, true)); } +#endif diff --git a/chrome/browser/sessions/tab_restore_service_unittest.cc b/chrome/browser/sessions/tab_restore_service_unittest.cc index d351e47..b288024 100644 --- a/chrome/browser/sessions/tab_restore_service_unittest.cc +++ b/chrome/browser/sessions/tab_restore_service_unittest.cc @@ -364,6 +364,7 @@ TEST_F(TabRestoreServiceTest, LoadPreviousSessionAndTabs) { EXPECT_TRUE(url3_ == tab->navigations[2].url()); } +#if defined(ENABLE_PINNED_TABS) // Make sure pinned state is correctly loaded from session service. TEST_F(TabRestoreServiceTest, LoadPreviousSessionAndTabsPinned) { CreateSessionServiceWithOneWindow(true); @@ -402,6 +403,7 @@ TEST_F(TabRestoreServiceTest, LoadPreviousSessionAndTabsPinned) { EXPECT_TRUE(url2_ == tab->navigations[1].url()); EXPECT_TRUE(url3_ == tab->navigations[2].url()); } +#endif // Creates TabRestoreService::kMaxEntries + 1 windows in the session service // and makes sure we only get back TabRestoreService::kMaxEntries on restore. |