diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-18 17:08:53 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-18 17:08:53 +0000 |
commit | 66fdbd5b47697242f38b6ea82e5e6df86786e489 (patch) | |
tree | 4fe44b90d97a29afbf969579c0cb10c152eb51e0 /chrome/common | |
parent | 07c4ce78c859c6913f6e1f5fe0d6a38e94cd2434 (diff) | |
download | chromium_src-66fdbd5b47697242f38b6ea82e5e6df86786e489.zip chromium_src-66fdbd5b47697242f38b6ea82e5e6df86786e489.tar.gz chromium_src-66fdbd5b47697242f38b6ea82e5e6df86786e489.tar.bz2 |
Move the PageType enum to content/public/common, put it into the content namespace, and also make it conform to the Content API enum naming convention.
BUG=98716
TBR=ananta
Review URL: http://codereview.chromium.org/8336013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106076 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/automation_messages.cc | 157 | ||||
-rw-r--r-- | chrome/common/automation_messages.h | 30 | ||||
-rw-r--r-- | chrome/common/automation_messages_internal.h | 2 |
3 files changed, 10 insertions, 179 deletions
diff --git a/chrome/common/automation_messages.cc b/chrome/common/automation_messages.cc index 2c79dd3..b6deaa1 100644 --- a/chrome/common/automation_messages.cc +++ b/chrome/common/automation_messages.cc @@ -219,163 +219,6 @@ void ParamTraits<AutomationMsg_Find_Params>::Log(const param_type& p, } // static -void ParamTraits<AutomationMsg_NavigationResponseValues>::Write( - Message* m, - const param_type& p) { - m->WriteInt(p); -} - -// static -bool ParamTraits<AutomationMsg_NavigationResponseValues>::Read(const Message* m, - void** iter, - param_type* p) { - int type; - if (!m->ReadInt(iter, &type)) - return false; - *p = static_cast<AutomationMsg_NavigationResponseValues>(type); - return true; -} - -// static -void ParamTraits<AutomationMsg_NavigationResponseValues>::Log( - const param_type& p, std::string* l) { - std::string control; - switch (p) { - case AUTOMATION_MSG_NAVIGATION_ERROR: - control = "AUTOMATION_MSG_NAVIGATION_ERROR"; - break; - case AUTOMATION_MSG_NAVIGATION_SUCCESS: - control = "AUTOMATION_MSG_NAVIGATION_SUCCESS"; - break; - case AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED: - control = "AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED"; - break; - default: - control = "UNKNOWN"; - break; - } - - LogParam(control, l); -} - -// static -void ParamTraits<AutomationMsg_ExtensionProperty>::Write(Message* m, - const param_type& p) { - m->WriteInt(p); -} - -// static -bool ParamTraits<AutomationMsg_ExtensionProperty>::Read(const Message* m, - void** iter, - param_type* p) { - int type; - if (!m->ReadInt(iter, &type)) - return false; - *p = static_cast<AutomationMsg_ExtensionProperty>(type); - return true; -} - -// static -void ParamTraits<AutomationMsg_ExtensionProperty>::Log(const param_type& p, - std::string* l) { - std::string control; - switch (p) { - case AUTOMATION_MSG_EXTENSION_ID: - control = "AUTOMATION_MSG_EXTENSION_ID"; - break; - case AUTOMATION_MSG_EXTENSION_NAME: - control = "AUTOMATION_MSG_EXTENSION_NAME"; - break; - case AUTOMATION_MSG_EXTENSION_VERSION: - control = "AUTOMATION_MSG_EXTENSION_VERSION"; - break; - case AUTOMATION_MSG_EXTENSION_BROWSER_ACTION_INDEX: - control = "AUTOMATION_MSG_EXTENSION_BROWSER_ACTION_INDEX"; - break; - default: - control = "UNKNOWN"; - break; - } - - LogParam(control, l); -} - -// static -void ParamTraits<SecurityStyle>::Write(Message* m, const param_type& p) { - m->WriteInt(p); -} - -// static -bool ParamTraits<SecurityStyle>::Read(const Message* m, - void** iter, - param_type* p) { - int type; - if (!m->ReadInt(iter, &type)) - return false; - *p = static_cast<SecurityStyle>(type); - return true; -} - -// static -void ParamTraits<SecurityStyle>::Log(const param_type& p, std::string* l) { - std::string control; - switch (p) { - case SECURITY_STYLE_UNKNOWN: - control = "SECURITY_STYLE_UNKNOWN"; - break; - case SECURITY_STYLE_UNAUTHENTICATED: - control = "SECURITY_STYLE_UNAUTHENTICATED"; - break; - case SECURITY_STYLE_AUTHENTICATION_BROKEN: - control = "SECURITY_STYLE_AUTHENTICATION_BROKEN"; - break; - case SECURITY_STYLE_AUTHENTICATED: - control = "SECURITY_STYLE_AUTHENTICATED"; - break; - default: - control = "UNKNOWN"; - break; - } - - LogParam(control, l); -} - -// static -void ParamTraits<PageType>::Write(Message* m, const param_type& p) { - m->WriteInt(p); -} - -// static -bool ParamTraits<PageType>::Read(const Message* m, void** iter, param_type* p) { - int type; - if (!m->ReadInt(iter, &type)) - return false; - *p = static_cast<PageType>(type); - return true; -} - -// static -void ParamTraits<PageType>::Log(const param_type& p, std::string* l) { - std::string control; - switch (p) { - case NORMAL_PAGE: - control = "NORMAL_PAGE"; - break; - case ERROR_PAGE: - control = "ERROR_PAGE"; - break; - case INTERSTITIAL_PAGE: - control = "INTERSTITIAL_PAGE"; - break; - default: - control = "UNKNOWN"; - break; - } - - LogParam(control, l); -} - -// static void ParamTraits<AutomationURLRequest>::Write(Message* m, const param_type& p) { WriteParam(m, p.url); WriteParam(m, p.method); diff --git a/chrome/common/automation_messages.h b/chrome/common/automation_messages.h index fa61419..bb156c4 100644 --- a/chrome/common/automation_messages.h +++ b/chrome/common/automation_messages.h @@ -11,9 +11,9 @@ #include "chrome/common/automation_constants.h" #include "chrome/common/content_settings.h" #include "content/common/common_param_traits.h" -#include "content/common/page_type.h" #include "content/common/security_style.h" #include "content/common/webkit_param_traits.h" +#include "content/public/common/page_type.h" #include "ipc/ipc_message_macros.h" #include "ipc/ipc_message_utils.h" #include "net/base/host_port_pair.h" @@ -256,35 +256,23 @@ struct ParamTraits<AutomationMsg_Find_Params> { }; template <> -struct ParamTraits<AutomationMsg_NavigationResponseValues> { - typedef AutomationMsg_NavigationResponseValues param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* p); - static void Log(const param_type& p, std::string* l); +struct SimilarTypeTraits<AutomationMsg_NavigationResponseValues> { + typedef int Type; }; template <> -struct ParamTraits<AutomationMsg_ExtensionProperty> { - typedef AutomationMsg_ExtensionProperty param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* p); - static void Log(const param_type& p, std::string* l); +struct SimilarTypeTraits<AutomationMsg_ExtensionProperty> { + typedef int Type; }; template <> -struct ParamTraits<SecurityStyle> { - typedef SecurityStyle param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* p); - static void Log(const param_type& p, std::string* l); +struct SimilarTypeTraits<SecurityStyle> { + typedef int Type; }; template <> -struct ParamTraits<PageType> { - typedef PageType param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* p); - static void Log(const param_type& p, std::string* l); +struct SimilarTypeTraits<content::PageType> { + typedef int Type; }; #if defined(OS_WIN) && !defined(USE_AURA) diff --git a/chrome/common/automation_messages_internal.h b/chrome/common/automation_messages_internal.h index 1532006..31299a8 100644 --- a/chrome/common/automation_messages_internal.h +++ b/chrome/common/automation_messages_internal.h @@ -573,7 +573,7 @@ IPC_SYNC_MESSAGE_CONTROL1_4(AutomationMsg_GetSecurityState, IPC_SYNC_MESSAGE_CONTROL1_2(AutomationMsg_GetPageType, int, bool, - PageType) + content::PageType) // This message simulates the user action on the SSL blocking page showing in // the specified tab. This message is only effective if an interstitial page |