summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-22 22:12:11 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-22 22:12:11 +0000
commit91695e7fc539f37646865f6212feb162580cabdd (patch)
tree9b3179db99e30a81333084d8fee0aab40c15e760 /chrome
parenta1634c41a7a2636c45f1d49bbb9c59e268c567c4 (diff)
downloadchromium_src-91695e7fc539f37646865f6212feb162580cabdd.zip
chromium_src-91695e7fc539f37646865f6212feb162580cabdd.tar.gz
chromium_src-91695e7fc539f37646865f6212feb162580cabdd.tar.bz2
Fixes bug in duplicating pinned tabs where duplicating a pinned tab
would only make the duplicated tab pinned if it was the last pinned tab. Now the duplicated tab is always pinned. BUG=41418 TEST=create two pinned tabs, duplicate the first and make sure the newly duplicated tab is pinned and between the first and second tabs. Review URL: http://codereview.chromium.org/1694010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45362 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index de54ece..216533c 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1969,14 +1969,9 @@ void Browser::DuplicateContentsAt(int index) {
// If this is a tabbed browser, just create a duplicate tab inside the same
// window next to the tab being duplicated.
new_contents = contents->Clone();
- // Make sure we force the index, otherwise the duplicate tab may appear at
- // the wrong location.
- tabstrip_model_.AddTabContents(new_contents, index + 1, true,
- PageTransition::LINK, true);
- if (tabstrip_model_.IsTabPinned(index)) {
- pinned = true;
- tabstrip_model_.SetTabPinned(index + 1, true);
- }
+ pinned = tabstrip_model_.IsTabPinned(index);
+ tabstrip_model_.InsertTabContentsAt(index + 1, new_contents, true,
+ true, pinned);
} else {
Browser* browser = NULL;
if (type_ & TYPE_APP) {