summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/api/web_navigation
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-12 01:53:30 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-12 01:53:30 +0000
commitb62084b5b4cc4923e8007495a482839a94c3704f (patch)
tree0af405b028f7af0e751301d18cf7c8c674a8aa36 /chrome/browser/extensions/api/web_navigation
parent6be34a67b24aef48908eeaa99643a180359309dc (diff)
downloadchromium_src-b62084b5b4cc4923e8007495a482839a94c3704f.zip
chromium_src-b62084b5b4cc4923e8007495a482839a94c3704f.tar.gz
chromium_src-b62084b5b4cc4923e8007495a482839a94c3704f.tar.bz2
TabContentsWrapper -> TabContents, part 12.
Extensions. BUG=131026 TEST=no change Review URL: https://chromiumcodereview.appspot.com/10535077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/api/web_navigation')
-rw-r--r--chrome/browser/extensions/api/web_navigation/web_navigation_api.cc35
-rw-r--r--chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc8
2 files changed, 25 insertions, 18 deletions
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
index a637e34..998130d 100644
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
@@ -16,7 +16,7 @@
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/retargeting_details.h"
-#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "chrome/browser/view_type_utils.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/url_constants.h"
@@ -458,11 +458,10 @@ void WebNavigationEventRouter::Retargeting(const RetargetingDetails* details) {
return;
// If the WebContents was created as a response to an IPC from a renderer
- // (and therefore doesn't yet have a wrapper), or if it isn't yet inserted
+ // (and therefore doesn't yet have a TabContents), or if it isn't yet inserted
// into a tab strip, we need to delay the extension event until the
// WebContents is fully initialized.
- if ((TabContentsWrapper::GetCurrentWrapperForContents(
- details->target_web_contents) == NULL) ||
+ if (TabContents::FromWebContents(details->target_web_contents) == NULL ||
details->not_yet_in_tabstrip) {
pending_web_contents_[details->target_web_contents] =
PendingWebContents(
@@ -731,14 +730,18 @@ bool GetFrameFunction::RunImpl() {
result_.reset(Value::CreateNullValue());
- TabContentsWrapper* wrapper;
- if (!ExtensionTabUtil::GetTabById(
- tab_id, profile(), include_incognito(), NULL, NULL, &wrapper, NULL) ||
- !wrapper) {
+ TabContents* tab_contents;
+ if (!ExtensionTabUtil::GetTabById(tab_id,
+ profile(),
+ include_incognito(),
+ NULL, NULL,
+ &tab_contents,
+ NULL) ||
+ !tab_contents) {
return true;
}
- WebContents* web_contents = wrapper->web_contents();
+ WebContents* web_contents = tab_contents->web_contents();
WebNavigationTabObserver* observer =
WebNavigationTabObserver::Get(web_contents);
DCHECK(observer);
@@ -774,14 +777,18 @@ bool GetAllFramesFunction::RunImpl() {
result_.reset(Value::CreateNullValue());
- TabContentsWrapper* wrapper;
- if (!ExtensionTabUtil::GetTabById(
- tab_id, profile(), include_incognito(), NULL, NULL, &wrapper, NULL) ||
- !wrapper) {
+ TabContents* tab_contents;
+ if (!ExtensionTabUtil::GetTabById(tab_id,
+ profile(),
+ include_incognito(),
+ NULL, NULL,
+ &tab_contents,
+ NULL) ||
+ !tab_contents) {
return true;
}
- WebContents* web_contents = wrapper->web_contents();
+ WebContents* web_contents = tab_contents->web_contents();
WebNavigationTabObserver* observer =
WebNavigationTabObserver::Get(web_contents);
DCHECK(observer);
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
index fef3a5b..1ebf8bb 100644
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
@@ -183,7 +183,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationUserAction) {
ASSERT_TRUE(
RunExtensionSubtest("webnavigation", "test_userAction.html")) << message_;
- WebContents* tab = browser()->GetSelectedWebContents();
+ WebContents* tab = browser()->GetActiveWebContents();
ui_test_utils::WaitForLoadStop(tab);
ResultCatcher catcher;
@@ -221,7 +221,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationRequestOpenTab) {
ASSERT_TRUE(RunExtensionSubtest("webnavigation", "test_requestOpenTab.html"))
<< message_;
- WebContents* tab = browser()->GetSelectedWebContents();
+ WebContents* tab = browser()->GetActiveWebContents();
ui_test_utils::WaitForLoadStop(tab);
ResultCatcher catcher;
@@ -258,7 +258,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationTargetBlank) {
ASSERT_TRUE(RunExtensionSubtest("webnavigation", "test_targetBlank.html"))
<< message_;
- WebContents* tab = browser()->GetSelectedWebContents();
+ WebContents* tab = browser()->GetActiveWebContents();
ui_test_utils::WaitForLoadStop(tab);
ResultCatcher catcher;
@@ -304,7 +304,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationTargetBlankIncognito) {
ui_test_utils::OpenURLOffTheRecord(browser()->profile(), url);
WebContents* tab = browser::FindTabbedBrowser(
browser()->profile()->GetOffTheRecordProfile(), false)->
- GetSelectedWebContents();
+ GetActiveWebContents();
// There's a link with target=_blank on a.html. Click on it to open it in a
// new tab.