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

Unified Diff: content/renderer/render_view_impl.cc

Issue 11798003: Move NavigationPolicyToDisposition() function into render_view_impl.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | webkit/glue/webkit_glue.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 37d1011dc930132ba83deb303b2f85c65398c999..8b10ecbcaeee9b13d1c3a89cc19c2ad3cc7bcbe0 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -146,6 +146,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIntentServiceInfo.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebMessagePortChannel.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebNavigationPolicy.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeList.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializer.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h"
@@ -339,6 +340,33 @@ using WebKit::WebFloatRect;
using WebKit::WebHitTestResult;
#endif
+namespace {
jam 2013/01/08 16:32:32 nit: in general, all code in content should be in
tfarina 2013/01/08 20:42:18 Done.
+
+WindowOpenDisposition NavigationPolicyToDisposition(
+ WebKit::WebNavigationPolicy policy) {
+ switch (policy) {
+ case WebKit::WebNavigationPolicyIgnore:
+ return IGNORE_ACTION;
+ case WebKit::WebNavigationPolicyDownload:
+ return SAVE_TO_DISK;
+ case WebKit::WebNavigationPolicyCurrentTab:
+ return CURRENT_TAB;
+ case WebKit::WebNavigationPolicyNewBackgroundTab:
+ return NEW_BACKGROUND_TAB;
+ case WebKit::WebNavigationPolicyNewForegroundTab:
+ return NEW_FOREGROUND_TAB;
+ case WebKit::WebNavigationPolicyNewWindow:
+ return NEW_WINDOW;
+ case WebKit::WebNavigationPolicyNewPopup:
+ return NEW_POPUP;
+ default:
+ NOTREACHED() << "Unexpected WebNavigationPolicy";
+ return IGNORE_ACTION;
+ }
+}
+
+} // namespace
+
namespace content {
//-----------------------------------------------------------------------------
« no previous file with comments | « no previous file | webkit/glue/webkit_glue.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698