Add chrome.tabs.getCurrent() api call to extensions.

This is primarily so that code running in an infobar can discover what tab the info is inserted in. It also works for code running directly in a TabContents. The call will return undefined if called from a background page or popup view.

BUG=40428
TEST=All tests should pass (additional tests included)

Review URL: http://codereview.chromium.org/1521032

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44542 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_tabs_apitest.cc b/chrome/browser/extensions/extension_tabs_apitest.cc
index 5f8e0aa7..64d42ed 100644
--- a/chrome/browser/extensions/extension_tabs_apitest.cc
+++ b/chrome/browser/extensions/extension_tabs_apitest.cc
@@ -28,6 +28,16 @@
   ASSERT_TRUE(RunExtensionTest("tabs/basics")) << message_;
 }
 
+IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Tabs2) {
+  StartHTTPServer();
+
+  // This test runs through additional tabs functionality.
+  browser()->profile()->GetPrefs()->SetBoolean(
+      prefs::kHomePageIsNewTabPage, true);
+
+  ASSERT_TRUE(RunExtensionTest("tabs/basics2")) << message_;
+}
+
 // TODO(skerner): This test is flaky on chrome os: http://crbug.com/41380
 #if defined(OS_LINUX) && defined(TOOLKIT_VIEWS)
 #define MAYBE_CaptureVisibleTab FLAKY_CaptureVisibleTab