summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-28 19:14:33 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-28 19:14:33 +0000
commitd3038bf0175f75df75385a17298134a2ee39b8a1 (patch)
treeeb795e71e50dfc7bb5f791af24e5d85b0abe54ac /chrome/browser
parentdb921de9330f6245dc93cf1529c8c180e74d1ae8 (diff)
downloadchromium_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')
-rw-r--r--chrome/browser/browser_init.cc9
-rw-r--r--chrome/browser/sessions/session_restore.cc26
-rw-r--r--chrome/browser/sessions/session_service.cc2
-rw-r--r--chrome/browser/sessions/session_service_unittest.cc4
-rw-r--r--chrome/browser/sessions/tab_restore_service_unittest.cc2
-rw-r--r--chrome/browser/tab_menu_model.cc2
-rw-r--r--chrome/browser/tab_menu_model.h2
7 files changed, 14 insertions, 33 deletions
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc
index 0a74de0..afef33e 100644
--- a/chrome/browser/browser_init.cc
+++ b/chrome/browser/browser_init.cc
@@ -588,13 +588,6 @@ Browser* BrowserInit::LaunchWithProfile::OpenURLsInBrowser(
if (!profile_ && browser)
profile_ = browser->profile();
- int pin_count = 0;
- if (!browser) {
- std::string pin_count_string =
- command_line_.GetSwitchValueASCII(switches::kPinnedTabCount);
- if (!pin_count_string.empty())
- pin_count = StringToInt(pin_count_string);
- }
if (!browser || browser->type() != Browser::TYPE_NORMAL)
browser = Browser::Create(profile_);
@@ -613,8 +606,6 @@ Browser* BrowserInit::LaunchWithProfile::OpenURLsInBrowser(
continue;
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 (profile_ && i == 0 && process_startup)
AddCrashedInfoBarIfNecessary(tab);
}
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.
diff --git a/chrome/browser/tab_menu_model.cc b/chrome/browser/tab_menu_model.cc
index f426250..986d352 100644
--- a/chrome/browser/tab_menu_model.cc
+++ b/chrome/browser/tab_menu_model.cc
@@ -18,6 +18,7 @@ void TabMenuModel::Build() {
AddItemWithStringId(TabStripModel::CommandReload, IDS_TAB_CXMENU_RELOAD);
AddItemWithStringId(TabStripModel::CommandDuplicate,
IDS_TAB_CXMENU_DUPLICATE);
+#if defined(ENABLE_PINNED_TABS)
// On Mac the HIG prefers "pin/unpin" to a checkmark. The Mac code will fix up
// the actual string based on the tab's state via the delegate.
#if defined(OS_MACOSX)
@@ -27,6 +28,7 @@ void TabMenuModel::Build() {
AddCheckItemWithStringId(TabStripModel::CommandTogglePinned,
IDS_TAB_CXMENU_PIN_TAB);
#endif
+#endif
AddSeparator();
AddItemWithStringId(TabStripModel::CommandCloseTab,
IDS_TAB_CXMENU_CLOSETAB);
diff --git a/chrome/browser/tab_menu_model.h b/chrome/browser/tab_menu_model.h
index d176fc9..c98731d 100644
--- a/chrome/browser/tab_menu_model.h
+++ b/chrome/browser/tab_menu_model.h
@@ -14,7 +14,7 @@ class Browser;
class TabMenuModel : public menus::SimpleMenuModel {
public:
explicit TabMenuModel(menus::SimpleMenuModel::Delegate* delegate);
- virtual ~TabMenuModel() { }
+ virtual ~TabMenuModel() {}
private:
void Build();