summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-22 00:35:26 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-22 00:35:26 +0000
commit898f59217801d33992b333af7ab371fcb0d47c41 (patch)
treef5051a798308ea150b5bf0dae81be70ccd9e581c /chrome/browser
parent90403b24fe3f04d3ff486a6f595995e147645421 (diff)
downloadchromium_src-898f59217801d33992b333af7ab371fcb0d47c41.zip
chromium_src-898f59217801d33992b333af7ab371fcb0d47c41.tar.gz
chromium_src-898f59217801d33992b333af7ab371fcb0d47c41.tar.bz2
Attempt 2 at landing this CL. The earlier one broke the build. We don't need to include the external_tab_container_win.h
file in tab_contents. That is the only change. Links opening up in the host browser in ChromeFrame would not show up as visited. This was because top level link navigations are directly sent via the OpenURL mechanism to the host browser and as a result the visited link history is not updated. Fix is to update the navigation history in the ExternalTabContainer::OpenURLFromTab function. We currently use the UpdateHistoryForNavigation function in TabContents which is also used by regular navigations initiated within the renderer. Fixes bug http://code.google.com/p/chromium/issues/detail?id=37262 Bug=37262 TBR=amit Review URL: http://codereview.chromium.org/2809067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53283 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/external_tab_container_win.cc16
-rw-r--r--chrome/browser/tab_contents/tab_contents.h3
2 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc
index edbd310..3257cdc 100644
--- a/chrome/browser/external_tab_container_win.cc
+++ b/chrome/browser/external_tab_container_win.cc
@@ -28,8 +28,10 @@
#include "chrome/browser/views/tab_contents/tab_contents_container.h"
#include "chrome/common/bindings_policy.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/common/render_messages.h"
#include "chrome/common/native_web_keyboard_event.h"
#include "chrome/common/notification_service.h"
+#include "chrome/common/page_transition_types.h"
#include "chrome/test/automation/automation_messages.h"
#include "grit/generated_resources.h"
#include "views/grid_layout.h"
@@ -311,6 +313,20 @@ void ExternalTabContainer::OpenURLFromTab(TabContents* source,
automation_->Send(new AutomationMsg_OpenURL(0, tab_handle_,
url, referrer,
disposition));
+ // TODO(ananta)
+ // We should populate other fields in the
+ // ViewHostMsg_FrameNavigate_Params structure. Another option could be
+ // to refactor the UpdateHistoryForNavigation function in TabContents.
+ ViewHostMsg_FrameNavigate_Params params;
+ params.referrer = referrer;
+ params.url = url;
+ params.page_id = -1;
+ params.transition = PageTransition::LINK;
+
+ NavigationController::LoadCommittedDetails details;
+ details.did_replace_entry = false;
+
+ tab_contents_->UpdateHistoryForNavigation(url, details, params);
}
break;
default:
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index 8d14246..31ccc12 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -738,6 +738,9 @@ class TabContents : public PageNavigator,
// TODO(brettw) TestTabContents shouldn't exist!
friend class TestTabContents;
+ // Used to access the UpdateHistoryForNavigation member function.
+ friend class ExternalTabContainer;
+
// Changes the IsLoading state and notifies delegate as needed
// |details| is used to provide details on the load that just finished
// (but can be null if not applicable). Can be overridden.