1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/extensions/extension_tab_util.h"
7 #include "base/logging.h"
8 #include "chrome/browser/sessions/session_id.h"
11 using content::WebContents
;
13 namespace extensions
{
16 int ExtensionTabUtil::GetWindowId(const Browser
* browser
) {
22 int ExtensionTabUtil::GetWindowIdOfTabStripModel(
23 const TabStripModel
* tab_strip_model
) {
29 int ExtensionTabUtil::GetTabId(const WebContents
* web_contents
) {
30 return SessionID::IdForTab(web_contents
);
34 int ExtensionTabUtil::GetWindowIdOfTab(const WebContents
* web_contents
) {
40 base::DictionaryValue
* ExtensionTabUtil::CreateTabValue(
41 const WebContents
* contents
,
42 TabStripModel
* tab_strip
,
44 const Extension
* extension
) {
50 base::ListValue
* ExtensionTabUtil::CreateTabList(const Browser
* browser
,
51 const Extension
* extension
) {
57 base::DictionaryValue
* ExtensionTabUtil::CreateTabValue(
58 const WebContents
* contents
,
59 TabStripModel
* tab_strip
,
66 bool ExtensionTabUtil::GetTabStripModel(const WebContents
* web_contents
,
67 TabStripModel
** tab_strip_model
,
74 bool ExtensionTabUtil::GetDefaultTab(Browser
* browser
,
75 content::WebContents
** contents
,
82 bool ExtensionTabUtil::GetTabById(int tab_id
,
84 bool include_incognito
,
86 TabStripModel
** tab_strip
,
87 content::WebContents
** contents
,
94 GURL
ExtensionTabUtil::ResolvePossiblyRelativeURL(const std::string
& url_string
,
95 const Extension
* extension
) {
101 bool ExtensionTabUtil::IsCrashURL(const GURL
& url
) {
107 void ExtensionTabUtil::CreateTab(WebContents
* web_contents
,
108 const std::string
& extension_id
,
109 WindowOpenDisposition disposition
,
110 const gfx::Rect
& initial_pos
,
116 void ExtensionTabUtil::ForEachTab(
117 const base::Callback
<void(WebContents
*)>& callback
) {
122 WindowController
* ExtensionTabUtil::GetWindowControllerOfTab(
123 const WebContents
* web_contents
) {
128 } // namespace extensions