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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | webkit/glue/webkit_glue.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 139 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
140 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHelperPlugin.h" 140 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHelperPlugin.h"
141 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" 141 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h"
142 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" 142 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h"
143 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" 143 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
144 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntent.h" 144 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntent.h"
145 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntentRequest.h" 145 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntentRequest.h"
146 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntentServiceInfo. h" 146 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntentServiceInfo. h"
147 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction. h" 147 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction. h"
148 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMessagePortChannel .h" 148 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMessagePortChannel .h"
149 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNavigationPolicy.h "
149 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeList.h" 150 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeList.h"
150 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializer.h" 151 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializer.h"
151 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" 152 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h"
152 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginAction.h" 153 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginAction.h"
153 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" 154 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h"
154 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginDocument.h" 155 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginDocument.h"
155 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" 156 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h"
156 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" 157 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h"
157 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" 158 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h"
158 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSearchableFormData .h" 159 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSearchableFormData .h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 using webkit_glue::WebPreferences; 333 using webkit_glue::WebPreferences;
333 using webkit_glue::WebURLResponseExtraDataImpl; 334 using webkit_glue::WebURLResponseExtraDataImpl;
334 335
335 #if defined(OS_ANDROID) 336 #if defined(OS_ANDROID)
336 using WebKit::WebContentDetectionResult; 337 using WebKit::WebContentDetectionResult;
337 using WebKit::WebFloatPoint; 338 using WebKit::WebFloatPoint;
338 using WebKit::WebFloatRect; 339 using WebKit::WebFloatRect;
339 using WebKit::WebHitTestResult; 340 using WebKit::WebHitTestResult;
340 #endif 341 #endif
341 342
343 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.
344
345 WindowOpenDisposition NavigationPolicyToDisposition(
346 WebKit::WebNavigationPolicy policy) {
347 switch (policy) {
348 case WebKit::WebNavigationPolicyIgnore:
349 return IGNORE_ACTION;
350 case WebKit::WebNavigationPolicyDownload:
351 return SAVE_TO_DISK;
352 case WebKit::WebNavigationPolicyCurrentTab:
353 return CURRENT_TAB;
354 case WebKit::WebNavigationPolicyNewBackgroundTab:
355 return NEW_BACKGROUND_TAB;
356 case WebKit::WebNavigationPolicyNewForegroundTab:
357 return NEW_FOREGROUND_TAB;
358 case WebKit::WebNavigationPolicyNewWindow:
359 return NEW_WINDOW;
360 case WebKit::WebNavigationPolicyNewPopup:
361 return NEW_POPUP;
362 default:
363 NOTREACHED() << "Unexpected WebNavigationPolicy";
364 return IGNORE_ACTION;
365 }
366 }
367
368 } // namespace
369
342 namespace content { 370 namespace content {
343 371
344 //----------------------------------------------------------------------------- 372 //-----------------------------------------------------------------------------
345 373
346 typedef std::map<WebKit::WebView*, RenderViewImpl*> ViewMap; 374 typedef std::map<WebKit::WebView*, RenderViewImpl*> ViewMap;
347 static base::LazyInstance<ViewMap> g_view_map = LAZY_INSTANCE_INITIALIZER; 375 static base::LazyInstance<ViewMap> g_view_map = LAZY_INSTANCE_INITIALIZER;
348 typedef std::map<int32, RenderViewImpl*> RoutingIDViewMap; 376 typedef std::map<int32, RenderViewImpl*> RoutingIDViewMap;
349 static base::LazyInstance<RoutingIDViewMap> g_routing_id_view_map = 377 static base::LazyInstance<RoutingIDViewMap> g_routing_id_view_map =
350 LAZY_INSTANCE_INITIALIZER; 378 LAZY_INSTANCE_INITIALIZER;
351 379
(...skipping 6154 matching lines...) Expand 10 before | Expand all | Expand 10 after
6506 } 6534 }
6507 #endif 6535 #endif
6508 6536
6509 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( 6537 void RenderViewImpl::OnReleaseDisambiguationPopupDIB(
6510 TransportDIB::Handle dib_handle) { 6538 TransportDIB::Handle dib_handle) {
6511 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6539 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6512 RenderProcess::current()->ReleaseTransportDIB(dib); 6540 RenderProcess::current()->ReleaseTransportDIB(dib);
6513 } 6541 }
6514 6542
6515 } // namespace content 6543 } // namespace content
OLDNEW
« 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