diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-06 06:35:37 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-06 06:35:37 +0000 |
commit | ee162d84652bb1dc914b12621722a9a3b706978f (patch) | |
tree | 273af9476a53d00545df00cd72c4efd85e27af4d /content | |
parent | 63b328fe08abc80c7202bda70c654b143895c322 (diff) | |
download | chromium_src-ee162d84652bb1dc914b12621722a9a3b706978f.zip chromium_src-ee162d84652bb1dc914b12621722a9a3b706978f.tar.gz chromium_src-ee162d84652bb1dc914b12621722a9a3b706978f.tar.bz2 |
Split ViewType between chrome and content
BUG=89642
TEST=still works
Review URL: http://codereview.chromium.org/8135026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104253 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/renderer_host/render_view_host_delegate.h | 2 | ||||
-rw-r--r-- | content/browser/tab_contents/interstitial_page.cc | 5 | ||||
-rw-r--r-- | content/browser/tab_contents/interstitial_page.h | 2 | ||||
-rw-r--r-- | content/browser/tab_contents/tab_contents.cc | 5 | ||||
-rw-r--r-- | content/browser/tab_contents/tab_contents.h | 2 | ||||
-rw-r--r-- | content/common/view_types.cc | 13 | ||||
-rw-r--r-- | content/common/view_types.h | 27 | ||||
-rw-r--r-- | content/content_common.gypi | 1 |
8 files changed, 19 insertions, 38 deletions
diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h index 2fa528a..65bb4ac 100644 --- a/content/browser/renderer_host/render_view_host_delegate.h +++ b/content/browser/renderer_host/render_view_host_delegate.h @@ -208,7 +208,7 @@ class CONTENT_EXPORT RenderViewHostDelegate : public IPC::Channel::Listener { virtual BackgroundContents* GetAsBackgroundContents(); // Return type of RenderView which is attached with this object. - virtual ViewType::Type GetRenderViewType() const = 0; + virtual content::ViewType::Type GetRenderViewType() const = 0; // The RenderView is being constructed (message sent to the renderer process // to construct a RenderView). Now is a good time to send other setup events diff --git a/content/browser/tab_contents/interstitial_page.cc b/content/browser/tab_contents/interstitial_page.cc index 6f0f271..9e7db60 100644 --- a/content/browser/tab_contents/interstitial_page.cc +++ b/content/browser/tab_contents/interstitial_page.cc @@ -28,6 +28,7 @@ #include "content/common/notification_source.h" #include "content/common/page_transition_types.h" #include "content/common/view_messages.h" +#include "content/common/view_types.h" #include "net/base/escape.h" #include "net/url_request/url_request_context_getter.h" @@ -529,8 +530,8 @@ void InterstitialPage::FocusThroughTabTraversal(bool reverse) { render_view_host_->SetInitialFocus(reverse); } -ViewType::Type InterstitialPage::GetRenderViewType() const { - return ViewType::INTERSTITIAL_PAGE; +content::ViewType::Type InterstitialPage::GetRenderViewType() const { + return content::ViewType::INTERSTITIAL_PAGE; } void InterstitialPage::Disable() { diff --git a/content/browser/tab_contents/interstitial_page.h b/content/browser/tab_contents/interstitial_page.h index d3b4c70..2da3667 100644 --- a/content/browser/tab_contents/interstitial_page.h +++ b/content/browser/tab_contents/interstitial_page.h @@ -102,7 +102,7 @@ class CONTENT_EXPORT InterstitialPage : public NotificationObserver, // Called when tab traversing. void FocusThroughTabTraversal(bool reverse); - virtual ViewType::Type GetRenderViewType() const; + virtual content::ViewType::Type GetRenderViewType() const; // See description above field. void set_reload_on_dont_proceed(bool value) { diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index 637b8ba..2d3cf8d 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -48,6 +48,7 @@ #include "content/common/notification_service.h" #include "content/common/url_constants.h" #include "content/common/view_messages.h" +#include "content/common/view_types.h" #include "net/base/net_util.h" #include "net/url_request/url_request_context_getter.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" @@ -1395,8 +1396,8 @@ TabContents* TabContents::GetAsTabContents() { return this; } -ViewType::Type TabContents::GetRenderViewType() const { - return ViewType::TAB_CONTENTS; +content::ViewType::Type TabContents::GetRenderViewType() const { + return content::ViewType::TAB_CONTENTS; } void TabContents::RenderViewCreated(RenderViewHost* render_view_host) { diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h index 4c9d70f..acdefbc 100644 --- a/content/browser/tab_contents/tab_contents.h +++ b/content/browser/tab_contents/tab_contents.h @@ -626,7 +626,7 @@ class CONTENT_EXPORT TabContents : public PageNavigator, virtual RenderViewHostDelegate::RendererManagement* GetRendererManagementDelegate() OVERRIDE; virtual TabContents* GetAsTabContents() OVERRIDE; - virtual ViewType::Type GetRenderViewType() const OVERRIDE; + virtual content::ViewType::Type GetRenderViewType() const OVERRIDE; virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; virtual void RenderViewReady(RenderViewHost* render_view_host) OVERRIDE; virtual void RenderViewGone(RenderViewHost* render_view_host, diff --git a/content/common/view_types.cc b/content/common/view_types.cc deleted file mode 100644 index ab02651..0000000 --- a/content/common/view_types.cc +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2011 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. - -#include "content/common/view_types.h" - -const char* const ViewType::kTabContents = "TAB"; -const char* const ViewType::kBackgroundPage = "BACKGROUND"; -const char* const ViewType::kPopup = "POPUP"; -const char* const ViewType::kInfobar = "INFOBAR"; -const char* const ViewType::kNotification = "NOTIFICATION"; -const char* const ViewType::kExtensionDialog = "EXTENSION_DIALOG"; -const char* const ViewType::kAll = "ALL"; diff --git a/content/common/view_types.h b/content/common/view_types.h index 6859180..4a28c68 100644 --- a/content/common/view_types.h +++ b/content/common/view_types.h @@ -9,31 +9,22 @@ #include "base/basictypes.h" #include "content/common/content_export.h" +namespace content { + // Indicates different types of views class CONTENT_EXPORT ViewType { public: - enum Type { + enum { INVALID, - BACKGROUND_CONTENTS, TAB_CONTENTS, - EXTENSION_BACKGROUND_PAGE, - EXTENSION_POPUP, - EXTENSION_INFOBAR, - DEV_TOOLS_UI, INTERSTITIAL_PAGE, - NOTIFICATION, - EXTENSION_DIALOG, + DEV_TOOLS_UI, + + VIEW_TYPE_CONTENT_END }; - // Constant strings corresponding to the Type enumeration values. Used - // when converting JS arguments. - static const char* const kTabContents; - static const char* const kBackgroundPage; - static const char* const kPopup; - static const char* const kInfobar; - static const char* const kNotification; - static const char* const kExtensionDialog; - static const char* const kAll; + // Use this type to clarify that a ViewType type should be used. + typedef int Type; private: // This class is for scoping only, so you shouldn't create an instance of it. @@ -42,4 +33,6 @@ class CONTENT_EXPORT ViewType { DISALLOW_COPY_AND_ASSIGN(ViewType); }; +} // namespace content + #endif // CONTENT_COMMON_VIEW_TYPES_H_ diff --git a/content/content_common.gypi b/content/content_common.gypi index 86b6862..5488f81 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -251,7 +251,6 @@ 'common/utility_messages.h', 'common/view_messages.h', 'common/view_message_enums.h', - 'common/view_types.cc', 'common/view_types.h', 'common/web_database_observer_impl.cc', 'common/web_database_observer_impl.h', |