summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_tabs_module.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/extensions/extension_tabs_module.cc')
-rw-r--r--chrome/browser/extensions/extension_tabs_module.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
index 5cd4242..12028c2 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -27,7 +27,6 @@
#include "skia/ext/platform_canvas.h"
#include "third_party/skia/include/core/SkBitmap.h"
-
namespace keys = extension_tabs_module_constants;
// Forward declare static helper functions defined below.
@@ -157,6 +156,22 @@ DictionaryValue* ExtensionTabUtil::CreateWindowValue(const Browser* browser,
return result;
}
+bool ExtensionTabUtil::GetDefaultTab(Browser* browser, TabContents** contents,
+ int* tab_id) {
+ DCHECK(browser);
+ DCHECK(contents);
+ DCHECK(tab_id);
+
+ *contents = browser->tabstrip_model()->GetSelectedTabContents();
+ if (*contents) {
+ if (tab_id)
+ *tab_id = ExtensionTabUtil::GetTabId(*contents);
+ return true;
+ }
+
+ return false;
+}
+
bool ExtensionTabUtil::GetTabById(int tab_id, Profile* profile,
Browser** browser,
TabStripModel** tab_strip,