summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-21 21:33:16 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-21 21:33:16 +0000
commita5500a1cc6aafe73ff19e0daeafdb935a3a0a6bc (patch)
treed73f8ea9aa66d82446f1629190e84c5013896507
parent679082058ce725b3bc6024c2bc01a7b99b79b3c6 (diff)
downloadchromium_src-a5500a1cc6aafe73ff19e0daeafdb935a3a0a6bc.zip
chromium_src-a5500a1cc6aafe73ff19e0daeafdb935a3a0a6bc.tar.gz
chromium_src-a5500a1cc6aafe73ff19e0daeafdb935a3a0a6bc.tar.bz2
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 Review URL: http://codereview.chromium.org/3020019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53247 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/external_tab_container_win.cc16
-rw-r--r--chrome/browser/tab_contents/tab_contents.h4
2 files changed, 20 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..227dcea 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -19,6 +19,7 @@
#include "chrome/browser/cancelable_request.h"
#include "chrome/browser/dom_ui/dom_ui_factory.h"
#include "chrome/browser/download/save_package.h"
+#include "chrome/browser/external_tab_container_win.h"
#include "chrome/browser/extensions/image_loading_tracker.h"
#include "chrome/browser/fav_icon_helper.h"
#include "chrome/browser/find_bar_controller.h"
@@ -738,6 +739,9 @@ class TabContents : public PageNavigator,
// TODO(brettw) TestTabContents shouldn't exist!
friend class TestTabContents;
+ // Used to access the UpdateHistoryForNavigation 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.