summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-25 19:43:52 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-25 19:43:52 +0000
commit90ba8dd800215d608ecab3c8d120b3cc91cb04d6 (patch)
treefa17334b0b327394f1334a47dc1e1bfb57bb2197 /chrome/browser/browser.cc
parent7f36bac6e4abaf59854bf807d6456b6a5c040930 (diff)
downloadchromium_src-90ba8dd800215d608ecab3c8d120b3cc91cb04d6.zip
chromium_src-90ba8dd800215d608ecab3c8d120b3cc91cb04d6.tar.gz
chromium_src-90ba8dd800215d608ecab3c8d120b3cc91cb04d6.tar.bz2
Fix a crash I introduced in r14053. It removed the setting of the controller in
one arm of an if statement. BUG=10930 Review URL: http://codereview.chromium.org/99003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14533 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r--chrome/browser/browser.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 2b81a0bb..50f1eae 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -640,9 +640,11 @@ void Browser::GoBack(WindowOpenDisposition disposition) {
NavigationController* controller = NULL;
if (disposition == NEW_FOREGROUND_TAB ||
disposition == NEW_BACKGROUND_TAB) {
- tabstrip_model_.AddTabContents(
- GetSelectedTabContents()->Clone(), -1,
- PageTransition::LINK, disposition == NEW_FOREGROUND_TAB);
+ TabContents* cloned = GetSelectedTabContents()->Clone();
+ tabstrip_model_.AddTabContents(cloned, -1,
+ PageTransition::LINK,
+ disposition == NEW_FOREGROUND_TAB);
+ controller = &cloned->controller();
} else {
// Default disposition is CURRENT_TAB.
controller = &current_tab->controller();
@@ -658,9 +660,11 @@ void Browser::GoForward(WindowOpenDisposition disp) {
if (GetSelectedTabContents()->controller().CanGoForward()) {
NavigationController* controller = 0;
if (disp == NEW_FOREGROUND_TAB || disp == NEW_BACKGROUND_TAB) {
- tabstrip_model_.AddTabContents(
- GetSelectedTabContents()->Clone(), -1,
- PageTransition::LINK, disp == NEW_FOREGROUND_TAB);
+ TabContents* cloned = GetSelectedTabContents()->Clone();
+ tabstrip_model_.AddTabContents(cloned, -1,
+ PageTransition::LINK,
+ disp == NEW_FOREGROUND_TAB);
+ controller = &cloned->controller();
} else {
// Default disposition is CURRENT_TAB.
controller = &GetSelectedTabContents()->controller();