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.
4
5#ifndef CHROME_BROWSER_UI_BROWSER_TABSTRIP_H_
6#define CHROME_BROWSER_UI_BROWSER_TABSTRIP_H_
7
8#include "content/public/browser/navigation_controller.h"
9#include "content/public/browser/web_contents.h"
10#include "content/public/common/page_transition_types.h"
11#include "ui/base/window_open_disposition.h"
12
13class Browser;
14class GURL;
15class Profile;
16
17namespace content {
18class SiteInstance;
19}
20
21namespace gfx {
22class Rect;
23}
24
25namespace chrome {
26
27// Adds a blank tab to the tab strip of the specified browser; an |index| of -1
28// means to append it to the end of the tab strip.
29void AddBlankTabAt(Browser* browser, int index, bool foreground);
30
31// Adds a selected tab with the specified URL and transition, returns the
32// created WebContents.
33content::WebContents* AddSelectedTabWithURL(Browser* browser,
34                                            const GURL& url,
35                                            content::PageTransition transition);
36
37// Creates a new tab with the already-created WebContents 'new_contents'.
38// The window for the added contents will be reparented correctly when this
39// method returns.  If |disposition| is NEW_POPUP, |pos| should hold the
40// initial position. If |was_blocked| is non-NULL, then |*was_blocked| will be
41// set to true if the popup gets blocked, and left unchanged otherwise.
42void AddWebContents(Browser* browser,
43                    content::WebContents* source_contents,
44                    content::WebContents* new_contents,
45                    WindowOpenDisposition disposition,
46                    const gfx::Rect& initial_pos,
47                    bool user_gesture,
48                    bool* was__blocked);
49
50// Closes the specified WebContents in the specified Browser. If
51// |add_to_history| is true, an entry in the historical tab database is created.
52void CloseWebContents(Browser* browser,
53                      content::WebContents* contents,
54                      bool add_to_history);
55
56}  // namespace chrome
57
58#endif  // CHROME_BROWSER_UI_BROWSER_TABSTRIP_H_
59