blob: f9115b98fcced4f8b081617234b5201d9279667f [file] [log] [blame]
[email protected]5d9cace72012-06-21 16:07:121// 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_SINGLETON_TABS_H_
6#define CHROME_BROWSER_UI_SINGLETON_TABS_H_
[email protected]5d9cace72012-06-21 16:07:127
thestige80821242015-09-30 23:46:088#include "chrome/browser/ui/browser_navigator_params.h"
9
[email protected]5d9cace72012-06-21 16:07:1210class Browser;
11class GURL;
12
[email protected]5d9cace72012-06-21 16:07:1213// Methods for opening "singleton tabs". Tabs are guaranteed unique by varying
14// metrics within a particular Browser window.
15
[email protected]5d9cace72012-06-21 16:07:1216// Core singleton tab API:
17
18// Show a given a URL. If a tab with the same URL (ignoring the ref) is
19// already visible in this browser, it becomes selected. Otherwise a new tab
20// is created.
21void ShowSingletonTab(Browser* browser, const GURL& url);
22
23// Same as ShowSingletonTab, but does not ignore ref.
24void ShowSingletonTabRespectRef(Browser* browser, const GURL& url);
25
26// As ShowSingletonTab, but if the current tab is the new tab page or
27// about:blank, then overwrite it with the passed contents.
28void ShowSingletonTabOverwritingNTP(Browser* browser,
[email protected]78e2edc2012-07-01 23:32:2829 const NavigateParams& params);
[email protected]5d9cace72012-06-21 16:07:1230
31// Creates a NavigateParams struct for a singleton tab navigation.
[email protected]78e2edc2012-07-01 23:32:2832NavigateParams GetSingletonTabNavigateParams(Browser* browser, const GURL& url);
[email protected]5d9cace72012-06-21 16:07:1233
Kevin Baileyc8f9ef322018-01-05 17:19:5534// If the given navigational URL is already open in |browser|, return
35// the tab and tab index for it. Otherwise, returns -1.
36int GetIndexOfExistingTab(Browser* browser, const NavigateParams& params);
[email protected]5d9cace72012-06-21 16:07:1237
[email protected]5d9cace72012-06-21 16:07:1238#endif // CHROME_BROWSER_UI_SINGLETON_TABS_H_