Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1249)

Unified Diff: chrome/renderer/extensions/extension_helper.cc

Issue 13375017: Move the ViewType enum to extensions\common. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/extensions/extension_helper.cc
===================================================================
--- chrome/renderer/extensions/extension_helper.cc (revision 191609)
+++ chrome/renderer/extensions/extension_helper.cc (working copy)
@@ -15,7 +15,6 @@
#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/url_constants.h"
-#include "chrome/common/view_type.h"
#include "chrome/renderer/extensions/chrome_v8_context.h"
#include "chrome/renderer/extensions/console.h"
#include "chrome/renderer/extensions/dispatcher.h"
@@ -67,7 +66,7 @@
public:
ViewAccumulator(const std::string& extension_id,
int browser_window_id,
- chrome::ViewType view_type)
+ ViewType view_type)
: extension_id_(extension_id),
browser_window_id_(browser_window_id),
view_type_(view_type) {
@@ -82,7 +81,7 @@
return true;
GURL url = render_view->GetWebView()->mainFrame()->document().url();
- if (!url.SchemeIs(extensions::kExtensionScheme))
+ if (!url.SchemeIs(kExtensionScheme))
return true;
const std::string& extension_id = url.host();
if (extension_id != extension_id_)
@@ -95,19 +94,19 @@
views_.push_back(render_view);
- if (view_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE)
+ if (view_type_ == VIEW_TYPE_EXTENSION_BACKGROUND_PAGE)
return false; // There can be only one...
return true;
}
private:
// Returns true if |type| "isa" |match|.
- static bool ViewTypeMatches(chrome::ViewType type, chrome::ViewType match) {
+ static bool ViewTypeMatches(ViewType type, ViewType match) {
if (type == match)
return true;
// INVALID means match all.
- if (match == chrome::VIEW_TYPE_INVALID)
+ if (match == VIEW_TYPE_INVALID)
return true;
return false;
@@ -115,7 +114,7 @@
std::string extension_id_;
int browser_window_id_;
- chrome::ViewType view_type_;
+ ViewType view_type_;
std::vector<content::RenderView*> views_;
};
@@ -125,7 +124,7 @@
std::vector<content::RenderView*> ExtensionHelper::GetExtensionViews(
const std::string& extension_id,
int browser_window_id,
- chrome::ViewType view_type) {
+ ViewType view_type) {
ViewAccumulator accumulator(extension_id, browser_window_id, view_type);
content::RenderView::ForEach(&accumulator);
return accumulator.views();
@@ -135,7 +134,7 @@
content::RenderView* ExtensionHelper::GetBackgroundPage(
const std::string& extension_id) {
ViewAccumulator accumulator(extension_id, extension_misc::kUnknownWindowId,
- chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE);
+ VIEW_TYPE_EXTENSION_BACKGROUND_PAGE);
content::RenderView::ForEach(&accumulator);
CHECK_LE(accumulator.views().size(), 1u);
if (accumulator.views().size() == 0)
@@ -149,7 +148,7 @@
content::RenderViewObserverTracker<ExtensionHelper>(render_view),
dispatcher_(dispatcher),
pending_app_icon_requests_(0),
- view_type_(chrome::VIEW_TYPE_INVALID),
+ view_type_(VIEW_TYPE_INVALID),
tab_id_(-1),
browser_window_id_(-1) {
}
@@ -217,9 +216,9 @@
void ExtensionHelper::DraggableRegionsChanged(WebKit::WebFrame* frame) {
WebKit::WebVector<WebKit::WebDraggableRegion> webregions =
frame->document().draggableRegions();
- std::vector<extensions::DraggableRegion> regions;
+ std::vector<DraggableRegion> regions;
for (size_t i = 0; i < webregions.size(); ++i) {
- extensions::DraggableRegion region;
+ DraggableRegion region;
region.bounds = webregions[i].bounds;
region.draggable = webregions[i].draggable;
regions.push_back(region);
@@ -349,7 +348,7 @@
routing_id(), page_id, app_info));
}
-void ExtensionHelper::OnNotifyRendererViewType(chrome::ViewType type) {
+void ExtensionHelper::OnNotifyRendererViewType(ViewType type) {
view_type_ = type;
}

Powered by Google App Engine
This is Rietveld 408576698