Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_COMMON_CHROME_VIEW_TYPE_H_ | 5 #ifndef CHROME_COMMON_CHROME_VIEW_TYPE_H_ |
| 6 #define CHROME_COMMON_CHROME_VIEW_TYPE_H_ | 6 #define CHROME_COMMON_CHROME_VIEW_TYPE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "content/public/common/view_type.h" | 9 namespace content { |
| 10 class WebContents; | |
| 11 } | |
| 10 | 12 |
| 11 namespace chrome { | 13 namespace chrome { |
| 12 | 14 |
| 13 // Icky RTTI used by a few systems to distinguish the host type of a given | 15 // Icky RTTI used by a few systems to distinguish the host type of a given |
| 14 // RenderViewHost or WebContents. | 16 // RenderViewHost or WebContents. |
| 15 // | 17 // |
| 16 // TODO(aa): Remove this and teach those systems to keep track of their own | 18 // TODO(aa): Remove this and teach those systems to keep track of their own |
| 17 // data. | 19 // data. |
| 18 enum ViewType { | 20 enum ViewType { |
| 19 VIEW_TYPE_CHROME_START = content::VIEW_TYPE_CONTENT_END, | 21 VIEW_TYPE_INVALID, |
| 20 | |
| 21 VIEW_TYPE_APP_SHELL, | 22 VIEW_TYPE_APP_SHELL, |
| 22 VIEW_TYPE_BACKGROUND_CONTENTS, | 23 VIEW_TYPE_BACKGROUND_CONTENTS, |
| 23 VIEW_TYPE_EXTENSION_BACKGROUND_PAGE, | 24 VIEW_TYPE_EXTENSION_BACKGROUND_PAGE, |
| 24 VIEW_TYPE_EXTENSION_DIALOG, | 25 VIEW_TYPE_EXTENSION_DIALOG, |
| 25 VIEW_TYPE_EXTENSION_INFOBAR, | 26 VIEW_TYPE_EXTENSION_INFOBAR, |
| 26 VIEW_TYPE_EXTENSION_POPUP, | 27 VIEW_TYPE_EXTENSION_POPUP, |
| 27 VIEW_TYPE_NOTIFICATION, | 28 VIEW_TYPE_NOTIFICATION, |
| 28 VIEW_TYPE_PANEL, | 29 VIEW_TYPE_PANEL, |
| 29 VIEW_TYPE_TAB_CONTENTS, | 30 VIEW_TYPE_TAB_CONTENTS, |
| 30 }; | 31 }; |
| 31 | 32 |
| 33 // Get/Set the type of a WebContents. | |
| 34 // GetViewType handles a NULL |tab| for convenience. | |
|
Avi (use Gerrit)
2012/05/23 03:22:52
... and returns what if given NULL?
jam
2012/05/23 04:18:38
Done.
| |
| 35 ViewType GetViewType(content::WebContents* tab); | |
| 36 void SetViewType(content::WebContents* tab, ViewType type); | |
| 37 | |
| 32 // Constant strings corresponding to the Type enumeration values. Used | 38 // Constant strings corresponding to the Type enumeration values. Used |
| 33 // when converting JS arguments. | 39 // when converting JS arguments. |
| 34 extern const char kViewTypeAll[]; | 40 extern const char kViewTypeAll[]; |
| 35 extern const char kViewTypeAppShell[]; | 41 extern const char kViewTypeAppShell[]; |
| 36 extern const char kViewTypeBackgroundPage[]; | 42 extern const char kViewTypeBackgroundPage[]; |
| 37 extern const char kViewTypeExtensionDialog[]; | 43 extern const char kViewTypeExtensionDialog[]; |
| 38 extern const char kViewTypeInfobar[]; | 44 extern const char kViewTypeInfobar[]; |
| 39 extern const char kViewTypeNotification[]; | 45 extern const char kViewTypeNotification[]; |
| 40 extern const char kViewTypePanel[]; | 46 extern const char kViewTypePanel[]; |
| 41 extern const char kViewTypePopup[]; | 47 extern const char kViewTypePopup[]; |
| 42 extern const char kViewTypeTabContents[]; | 48 extern const char kViewTypeTabContents[]; |
| 43 | 49 |
| 44 } // namespace chrome | 50 } // namespace chrome |
| 45 | 51 |
| 46 #endif // CHROME_COMMON_CHROME_VIEW_TYPE_H_ | 52 #endif // CHROME_COMMON_CHROME_VIEW_TYPE_H_ |
| OLD | NEW |