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

Side by Side Diff: content/renderer/render_view.cc

Issue 7484061: Use the suggested name from an anchor's 'download' attribute. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 2011 Created 9 years, 5 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 5 #include "content/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameDetached(frame)); 1972 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameDetached(frame));
1973 } 1973 }
1974 1974
1975 void RenderView::willClose(WebFrame* frame) { 1975 void RenderView::willClose(WebFrame* frame) {
1976 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame)); 1976 FOR_EACH_OBSERVER(RenderViewObserver, observers_, FrameWillClose(frame));
1977 } 1977 }
1978 1978
1979 void RenderView::loadURLExternally( 1979 void RenderView::loadURLExternally(
1980 WebFrame* frame, const WebURLRequest& request, 1980 WebFrame* frame, const WebURLRequest& request,
1981 WebNavigationPolicy policy) { 1981 WebNavigationPolicy policy) {
1982 loadURLExternally(frame, request, policy, WebString());
1983 }
1984
1985 void RenderView::loadURLExternally(
1986 WebFrame* frame, const WebURLRequest& request,
1987 WebNavigationPolicy policy,
1988 const WebString& suggested_name) {
1982 GURL referrer(request.httpHeaderField(WebString::fromUTF8("Referer"))); 1989 GURL referrer(request.httpHeaderField(WebString::fromUTF8("Referer")));
1983 if (policy == WebKit::WebNavigationPolicyDownload) { 1990 if (policy == WebKit::WebNavigationPolicyDownload) {
1984 Send(new ViewHostMsg_DownloadUrl(routing_id_, request.url(), referrer)); 1991 Send(new ViewHostMsg_DownloadUrl(routing_id_, request.url(), referrer,
1992 suggested_name));
1985 } else { 1993 } else {
1986 OpenURL(request.url(), referrer, policy); 1994 OpenURL(request.url(), referrer, policy);
1987 } 1995 }
1988 } 1996 }
1989 1997
1990 WebNavigationPolicy RenderView::decidePolicyForNavigation( 1998 WebNavigationPolicy RenderView::decidePolicyForNavigation(
1991 WebFrame* frame, const WebURLRequest& request, WebNavigationType type, 1999 WebFrame* frame, const WebURLRequest& request, WebNavigationType type,
1992 const WebNode&, WebNavigationPolicy default_policy, bool is_redirect) { 2000 const WebNode&, WebNavigationPolicy default_policy, bool is_redirect) {
1993 // TODO(creis): Remove this when we fix OnSwapOut to not need a navigation. 2001 // TODO(creis): Remove this when we fix OnSwapOut to not need a navigation.
1994 if (is_swapped_out_) { 2002 if (is_swapped_out_) {
(...skipping 2321 matching lines...) Expand 10 before | Expand all | Expand 10 after
4316 } 4324 }
4317 #endif 4325 #endif
4318 4326
4319 void RenderView::OnContextMenuClosed( 4327 void RenderView::OnContextMenuClosed(
4320 const webkit_glue::CustomContextMenuContext& custom_context) { 4328 const webkit_glue::CustomContextMenuContext& custom_context) {
4321 if (custom_context.is_pepper_menu) 4329 if (custom_context.is_pepper_menu)
4322 pepper_delegate_.OnContextMenuClosed(custom_context); 4330 pepper_delegate_.OnContextMenuClosed(custom_context);
4323 else 4331 else
4324 context_menu_node_.reset(); 4332 context_menu_node_.reset();
4325 } 4333 }
OLDNEW
« chrome/browser/download/download_create_info.h ('K') | « content/renderer/render_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698