diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-12 15:53:56 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-12 15:53:56 +0000 |
commit | da4dfc470626ec77c6eb3ace17e0ef009bb7f32f (patch) | |
tree | 67889a0b4921c28adcb5f7389240379351bac80f /chrome/renderer | |
parent | 03e09864d6b5738fab87b3d1e5aaeca35b0d08b6 (diff) | |
download | chromium_src-da4dfc470626ec77c6eb3ace17e0ef009bb7f32f.zip chromium_src-da4dfc470626ec77c6eb3ace17e0ef009bb7f32f.tar.gz chromium_src-da4dfc470626ec77c6eb3ace17e0ef009bb7f32f.tar.bz2 |
Move view_types to content\public\common. Also update the enum values to match the convention that we're using for the Content API.
BUG=98716
Review URL: http://codereview.chromium.org/8232024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105083 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/extensions/extension_helper.cc | 4 | ||||
-rw-r--r-- | chrome/renderer/extensions/extension_helper.h | 8 | ||||
-rw-r--r-- | chrome/renderer/extensions/extension_process_bindings.cc | 41 |
3 files changed, 26 insertions, 27 deletions
diff --git a/chrome/renderer/extensions/extension_helper.cc b/chrome/renderer/extensions/extension_helper.cc index 34bb2c9..f516603 100644 --- a/chrome/renderer/extensions/extension_helper.cc +++ b/chrome/renderer/extensions/extension_helper.cc @@ -54,7 +54,7 @@ ExtensionHelper::ExtensionHelper(content::RenderView* render_view, content::RenderViewObserverTracker<ExtensionHelper>(render_view), extension_dispatcher_(extension_dispatcher), pending_app_icon_requests_(0), - view_type_(content::ViewType::INVALID), + view_type_(content::VIEW_TYPE_INVALID), browser_window_id_(-1) { } @@ -259,7 +259,7 @@ void ExtensionHelper::OnGetApplicationInfo(int page_id) { routing_id(), page_id, app_info)); } -void ExtensionHelper::OnNotifyRendererViewType(content::ViewType::Type type) { +void ExtensionHelper::OnNotifyRendererViewType(content::ViewType type) { view_type_ = type; } diff --git a/chrome/renderer/extensions/extension_helper.h b/chrome/renderer/extensions/extension_helper.h index 261d638..b136e73 100644 --- a/chrome/renderer/extensions/extension_helper.h +++ b/chrome/renderer/extensions/extension_helper.h @@ -13,7 +13,7 @@ #include "base/memory/scoped_ptr.h" #include "content/public/renderer/render_view_observer.h" #include "content/public/renderer/render_view_observer_tracker.h" -#include "content/common/view_types.h" +#include "content/public/common/view_types.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" class ExtensionDispatcher; @@ -52,7 +52,7 @@ class ExtensionHelper GURL requestor_url); int browser_window_id() const { return browser_window_id_; } - content::ViewType::Type view_type() const { return view_type_; } + content::ViewType view_type() const { return view_type_; } private: // RenderViewObserver implementation. @@ -76,7 +76,7 @@ class ExtensionHelper const std::string& message); void OnExecuteCode(const ExtensionMsg_ExecuteCode_Params& params); void OnGetApplicationInfo(int page_id); - void OnNotifyRendererViewType(content::ViewType::Type view_type); + void OnNotifyRendererViewType(content::ViewType view_type); void OnUpdateBrowserWindowId(int window_id); void OnInlineWebstoreInstallResponse( int install_id, bool success, const std::string& error); @@ -114,7 +114,7 @@ class ExtensionHelper int pending_app_icon_requests_; // Type of view attached with RenderView. - content::ViewType::Type view_type_; + content::ViewType view_type_; // Id number of browser window which RenderView is attached to. int browser_window_id_; diff --git a/chrome/renderer/extensions/extension_process_bindings.cc b/chrome/renderer/extensions/extension_process_bindings.cc index d6c37e5..223ecd0 100644 --- a/chrome/renderer/extensions/extension_process_bindings.cc +++ b/chrome/renderer/extensions/extension_process_bindings.cc @@ -85,7 +85,7 @@ class ExtensionViewAccumulator : public content::RenderViewVisitor { public: ExtensionViewAccumulator(const std::string& extension_id, int browser_window_id, - content::ViewType::Type view_type) + content::ViewType view_type) : extension_id_(extension_id), browser_window_id_(browser_window_id), view_type_(view_type), @@ -131,20 +131,19 @@ class ExtensionViewAccumulator : public content::RenderViewVisitor { views_->Set(v8::Integer::New(index_), view_window); index_++; - if (view_type_ == chrome::ViewType::EXTENSION_BACKGROUND_PAGE) + if (view_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) return false; // There can be only one... return true; } // Returns true is |type| "isa" |match|. - static bool ViewTypeMatches(content::ViewType::Type type, - content::ViewType::Type match) { + static bool ViewTypeMatches(content::ViewType type, content::ViewType match) { if (type == match) return true; // INVALID means match all. - if (match == content::ViewType::INVALID) + if (match == content::VIEW_TYPE_INVALID) return true; return false; @@ -152,7 +151,7 @@ class ExtensionViewAccumulator : public content::RenderViewVisitor { std::string extension_id_; int browser_window_id_; - content::ViewType::Type view_type_; + content::ViewType view_type_; v8::Local<v8::Array> views_; int index_; }; @@ -229,22 +228,22 @@ class ExtensionImpl : public ChromeV8Extension { std::string view_type_string = *v8::String::Utf8Value(args[1]->ToString()); StringToUpperASCII(&view_type_string); - // |view_type| == content::ViewType::INVALID means getting any type of + // |view_type| == content::VIEW_TYPE_INVALID means getting any type of // views. - content::ViewType::Type view_type = content::ViewType::INVALID; - if (view_type_string == chrome::ViewType::kBackgroundPage) { - view_type = chrome::ViewType::EXTENSION_BACKGROUND_PAGE; - } else if (view_type_string == chrome::ViewType::kInfobar) { - view_type = chrome::ViewType::EXTENSION_INFOBAR; - } else if (view_type_string == chrome::ViewType::kNotification) { - view_type = chrome::ViewType::NOTIFICATION; - } else if (view_type_string == chrome::ViewType::kTabContents) { - view_type = content::ViewType::TAB_CONTENTS; - } else if (view_type_string == chrome::ViewType::kPopup) { - view_type = chrome::ViewType::EXTENSION_POPUP; - } else if (view_type_string == chrome::ViewType::kExtensionDialog) { - view_type = chrome::ViewType::EXTENSION_DIALOG; - } else if (view_type_string != chrome::ViewType::kAll) { + content::ViewType view_type = content::VIEW_TYPE_INVALID; + if (view_type_string == chrome::kViewTypeBackgroundPage) { + view_type = chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE; + } else if (view_type_string == chrome::kViewTypeInfobar) { + view_type = chrome::VIEW_TYPE_EXTENSION_INFOBAR; + } else if (view_type_string == chrome::kViewTypeNotification) { + view_type = chrome::VIEW_TYPE_NOTIFICATION; + } else if (view_type_string == chrome::kViewTypeTabContents) { + view_type = content::VIEW_TYPE_TAB_CONTENTS; + } else if (view_type_string == chrome::kViewTypePopup) { + view_type = chrome::VIEW_TYPE_EXTENSION_POPUP; + } else if (view_type_string == chrome::kViewTypeExtensionDialog) { + view_type = chrome::VIEW_TYPE_EXTENSION_DIALOG; + } else if (view_type_string != chrome::kViewTypeAll) { return v8::Undefined(); } |