Chromium Code Reviews| Index: chrome/browser/ui/tab_contents/tab_contents_wrapper_container.h |
| diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper_container.h b/chrome/browser/ui/tab_contents/tab_contents_wrapper_container.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a74a90de7323d8d82def735e56ea9df3a4551845 |
| --- /dev/null |
| +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper_container.h |
| @@ -0,0 +1,49 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_CONTAINER_H_ |
| +#define CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_CONTAINER_H_ |
| +#pragma once |
| + |
| +class TabContentsWrapper; |
| + |
| +namespace content { |
| + class NavigationController; |
|
sky
2012/03/05 16:30:56
nit: no spaces.
altimofeev
2012/03/07 21:01:39
Done.
|
| + class WebContents; |
| +} |
| + |
| +// Interface which provides simple functionality for accessing |
| +// TabContentsWrapper instances. |
| +class TabContentsWrapperContainer { |
|
sky
2012/03/05 16:30:56
This name is overly generic. Is there a more speci
altimofeev
2012/03/07 21:01:39
No variant comes to my mind. Do you have a suggest
sky
2012/03/07 23:32:38
It's used by the toolbarmodel, so name it ToolbarM
|
| + public: |
| + TabContentsWrapperContainer() {} |
|
tfarina
2012/03/05 17:30:24
nit: for pure abstract class (i.e, interface) you
altimofeev
2012/03/07 21:01:39
Done.
|
| + virtual ~TabContentsWrapperContainer() {} |
|
tfarina
2012/03/05 17:30:24
nit: is it possible to make this protected?
altimofeev
2012/03/07 21:01:39
Why do that?
sky
2012/03/07 23:32:38
A protected virtual destructor makes it clear that
|
| + |
| + // Count of TCWs in the container. |
|
tfarina
2012/03/05 17:30:24
nit: // Returns the number of TCWs in this contain
altimofeev
2012/03/07 21:01:39
Done.
|
| + virtual int tab_count() const = 0; |
|
sky
2012/03/05 16:30:56
Doesn't use hacker_style for virtual methods. Addi
altimofeev
2012/03/05 17:13:24
Will fix hacker_style methods.
Concerning the com
|
| + |
| + // Index of the active TCW. |
|
tfarina
2012/03/05 17:30:24
nit: // Returns the index of the active TCW.
altimofeev
2012/03/07 21:01:39
Done.
|
| + virtual int active_index() const = 0; |
| + |
| + virtual int GetIndexOfController( |
| + const content::NavigationController* controller) const = 0; |
| + |
| + // Returns active TCW. |
| + // TODO(dpapad): Rename to GetActiveTabContentsWrapper(). |
| + virtual TabContentsWrapper* GetSelectedTabContentsWrapper() const = 0; |
| + |
| + // A convenient version of the above which returns the TCW's WebContents. |
| + virtual content::WebContents* GetSelectedWebContents() const = 0; |
| + |
| + // Returns TCW at specified index. |
| + virtual TabContentsWrapper* GetTabContentsWrapperAt(int index) const = 0; |
| + |
| + // A convenient version of the above which returns the TCW's WebContents. |
| + virtual content::WebContents* GetWebContentsAt(int index) const = 0; |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(TabContentsWrapperContainer); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_CONTAINER_H_ |