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

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: fix nit 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 499
499 static void NotifyTimezoneChange(WebKit::WebFrame* frame) { 500 static void NotifyTimezoneChange(WebKit::WebFrame* frame) {
500 v8::HandleScope handle_scope; 501 v8::HandleScope handle_scope;
501 v8::Context::Scope context_scope(frame->mainWorldScriptContext()); 502 v8::Context::Scope context_scope(frame->mainWorldScriptContext());
502 v8::Date::DateTimeConfigurationChangeNotification(); 503 v8::Date::DateTimeConfigurationChangeNotification();
503 WebKit::WebFrame* child = frame->firstChild(); 504 WebKit::WebFrame* child = frame->firstChild();
504 for (; child; child = child->nextSibling()) 505 for (; child; child = child->nextSibling())
505 NotifyTimezoneChange(child); 506 NotifyTimezoneChange(child);
506 } 507 }
507 508
509 static WindowOpenDisposition NavigationPolicyToDisposition(
510 WebNavigationPolicy policy) {
511 switch (policy) {
512 case WebKit::WebNavigationPolicyIgnore:
513 return IGNORE_ACTION;
514 case WebKit::WebNavigationPolicyDownload:
515 return SAVE_TO_DISK;
516 case WebKit::WebNavigationPolicyCurrentTab:
517 return CURRENT_TAB;
518 case WebKit::WebNavigationPolicyNewBackgroundTab:
519 return NEW_BACKGROUND_TAB;
520 case WebKit::WebNavigationPolicyNewForegroundTab:
521 return NEW_FOREGROUND_TAB;
522 case WebKit::WebNavigationPolicyNewWindow:
523 return NEW_WINDOW;
524 case WebKit::WebNavigationPolicyNewPopup:
525 return NEW_POPUP;
526 default:
527 NOTREACHED() << "Unexpected WebNavigationPolicy";
528 return IGNORE_ACTION;
529 }
530 }
531
508 /////////////////////////////////////////////////////////////////////////////// 532 ///////////////////////////////////////////////////////////////////////////////
509 533
510 struct RenderViewImpl::PendingFileChooser { 534 struct RenderViewImpl::PendingFileChooser {
511 PendingFileChooser(const FileChooserParams& p, WebFileChooserCompletion* c) 535 PendingFileChooser(const FileChooserParams& p, WebFileChooserCompletion* c)
512 : params(p), 536 : params(p),
513 completion(c) { 537 completion(c) {
514 } 538 }
515 FileChooserParams params; 539 FileChooserParams params;
516 WebFileChooserCompletion* completion; // MAY BE NULL to skip callback. 540 WebFileChooserCompletion* completion; // MAY BE NULL to skip callback.
517 }; 541 };
(...skipping 5988 matching lines...) Expand 10 before | Expand all | Expand 10 after
6506 } 6530 }
6507 #endif 6531 #endif
6508 6532
6509 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( 6533 void RenderViewImpl::OnReleaseDisambiguationPopupDIB(
6510 TransportDIB::Handle dib_handle) { 6534 TransportDIB::Handle dib_handle) {
6511 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6535 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6512 RenderProcess::current()->ReleaseTransportDIB(dib); 6536 RenderProcess::current()->ReleaseTransportDIB(dib);
6513 } 6537 }
6514 6538
6515 } // namespace content 6539 } // 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