summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 23:27:50 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 23:27:50 +0000
commit789f7a6237c4e64672d1f8ce5f21df56e49eb759 (patch)
tree086b9461cba8cb8f88cb402efbde1bc96abfb1b6
parentdfabc13bc1933e5c4aadf4bd5e3fc2daa5e330b9 (diff)
downloadchromium_src-789f7a6237c4e64672d1f8ce5f21df56e49eb759.zip
chromium_src-789f7a6237c4e64672d1f8ce5f21df56e49eb759.tar.gz
chromium_src-789f7a6237c4e64672d1f8ce5f21df56e49eb759.tar.bz2
Revert 50673 - Fix pinned tab link navigations.
This ties up that loose end I mentioned in http://codereview.chromium.org/2747011 (I had put this off because I expected it would require slightly more effort). BUG=29281 TEST=manual Review URL: http://codereview.chromium.org/2844017 TBR=estade@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50908 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/tabs/tab_strip_model.cc33
-rw-r--r--chrome/common/renderer_preferences.h5
2 files changed, 15 insertions, 23 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index d65e126..7db00b0 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -17,7 +17,6 @@
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_process_host.h"
-#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/sessions/tab_restore_service.h"
#include "chrome/browser/tabs/tab_strip_model_order_controller.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
@@ -175,7 +174,7 @@ TabContents* TabStripModel::DetachTabContentsAt(int index) {
TabContents* removed_contents = GetContentsAt(index);
int next_selected_index =
order_controller_->DetermineNewSelectedIndex(index, true);
- delete contents_data_[index];
+ delete contents_data_.at(index);
contents_data_.erase(contents_data_.begin() + index);
next_selected_index = IndexOfNextNonPhantomTab(next_selected_index, -1);
if (!HasNonPhantomTabs())
@@ -287,7 +286,7 @@ bool TabStripModel::TabsAreLoading() const {
NavigationController* TabStripModel::GetOpenerOfTabContentsAt(int index) {
DCHECK(ContainsIndex(index));
- return contents_data_[index]->opener;
+ return contents_data_.at(index)->opener;
}
int TabStripModel::GetIndexOfNextTabContentsOpenedBy(
@@ -379,14 +378,14 @@ void TabStripModel::ForgetAllOpeners() {
void TabStripModel::ForgetGroup(TabContents* contents) {
int index = GetIndexOfTabContents(contents);
DCHECK(ContainsIndex(index));
- contents_data_[index]->SetGroup(NULL);
- contents_data_[index]->ForgetOpener();
+ contents_data_.at(index)->SetGroup(NULL);
+ contents_data_.at(index)->ForgetOpener();
}
bool TabStripModel::ShouldResetGroupOnSelect(TabContents* contents) const {
int index = GetIndexOfTabContents(contents);
DCHECK(ContainsIndex(index));
- return contents_data_[index]->reset_group_on_select;
+ return contents_data_.at(index)->reset_group_on_select;
}
void TabStripModel::SetTabBlocked(int index, bool blocked) {
@@ -404,14 +403,6 @@ void TabStripModel::SetTabPinned(int index, bool pinned) {
if (contents_data_[index]->pinned == pinned)
return;
- // Reroute toplevel requests to the browser if the tab is pinned. This allows
- // us to rewrite the WindowOpenDisposition in certain cases.
- TabContents* contents = contents_data_[index]->contents;
- contents->GetMutableRendererPrefs()->browser_handles_top_level_requests =
- pinned;
- if (contents->render_view_host())
- contents->render_view_host()->SyncRendererPrefs();
-
if (IsAppTab(index)) {
// Changing the pinned state of an app tab doesn't effect it's mini-tab
// status.
@@ -430,13 +421,15 @@ void TabStripModel::SetTabPinned(int index, bool pinned) {
}
FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
- TabMiniStateChanged(contents, index));
+ TabMiniStateChanged(contents_data_[index]->contents,
+ index));
}
// else: the tab was at the boundary and it's position doesn't need to
// change.
FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
- TabPinnedStateChanged(contents, index));
+ TabPinnedStateChanged(contents_data_[index]->contents,
+ index));
}
bool TabStripModel::IsTabPinned(int index) const {
@@ -525,7 +518,7 @@ void TabStripModel::AddTabContents(TabContents* contents,
// Reset the index, just in case insert ended up moving it on us.
index = GetIndexOfTabContents(contents);
if (inherit_group && transition == PageTransition::TYPED)
- contents_data_[index]->reset_group_on_select = true;
+ contents_data_.at(index)->reset_group_on_select = true;
// Ensure that the new TabContentsView begins at the same size as the
// previous TabContentsView if it existed. Otherwise, the initial WebKit
@@ -944,7 +937,7 @@ void TabStripModel::InternalCloseTab(TabContents* contents,
TabContents* TabStripModel::GetContentsAt(int index) const {
CHECK(ContainsIndex(index)) <<
"Failed to find: " << index << " in: " << count() << " entries.";
- return contents_data_[index]->contents;
+ return contents_data_.at(index)->contents;
}
void TabStripModel::ChangeSelectedContentsFrom(
@@ -969,7 +962,7 @@ void TabStripModel::ChangeSelectedContentsFrom(
void TabStripModel::SetOpenerForContents(TabContents* contents,
TabContents* opener) {
int index = GetIndexOfTabContents(contents);
- contents_data_[index]->opener = &opener->controller();
+ contents_data_.at(index)->opener = &opener->controller();
}
void TabStripModel::SelectRelativeTab(bool next) {
@@ -1057,7 +1050,7 @@ void TabStripModel::MakePhantom(int index) {
void TabStripModel::MoveTabContentsAtImpl(int index, int to_position,
bool select_after_move) {
- TabContentsData* moved_data = contents_data_[index];
+ TabContentsData* moved_data = contents_data_.at(index);
contents_data_.erase(contents_data_.begin() + index);
contents_data_.insert(contents_data_.begin() + to_position, moved_data);
diff --git a/chrome/common/renderer_preferences.h b/chrome/common/renderer_preferences.h
index be6524e..7a55b17 100644
--- a/chrome/common/renderer_preferences.h
+++ b/chrome/common/renderer_preferences.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -63,8 +63,7 @@ struct RendererPreferences {
SkColor inactive_selection_bg_color;
SkColor inactive_selection_fg_color;
- // Browser wants a look at all top level requests. This is set to true for
- // external tabs and pinned tabs.
+ // Browser wants a look at all top level requests
bool browser_handles_top_level_requests;
// Cursor blink rate in seconds.