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

Side by Side Diff: content/browser/web_contents/render_view_host_manager.cc

Issue 10836164: Change policy to not trigger dangerous download UI for web intents dispatched files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use the ChromeRenderViewHostTestHarness Created 8 years, 3 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 | « chrome/browser/download/chrome_download_manager_delegate_unittest.cc ('k') | no next file » | 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/browser/web_contents/render_view_host_manager.h" 5 #include "content/browser/web_contents/render_view_host_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 render_widget_delegate_(render_widget_delegate), 49 render_widget_delegate_(render_widget_delegate),
50 render_view_host_(NULL), 50 render_view_host_(NULL),
51 pending_render_view_host_(NULL), 51 pending_render_view_host_(NULL),
52 interstitial_page_(NULL) { 52 interstitial_page_(NULL) {
53 } 53 }
54 54
55 RenderViewHostManager::~RenderViewHostManager() { 55 RenderViewHostManager::~RenderViewHostManager() {
56 if (pending_render_view_host_) 56 if (pending_render_view_host_)
57 CancelPending(); 57 CancelPending();
58 58
59 // We should always have a main RenderViewHost. 59 // We should always have a main RenderViewHost except in some tests.
60 RenderViewHostImpl* render_view_host = render_view_host_; 60 RenderViewHostImpl* render_view_host = render_view_host_;
61 render_view_host_ = NULL; 61 render_view_host_ = NULL;
62 render_view_host->Shutdown(); 62 if (render_view_host)
63 render_view_host->Shutdown();
63 64
64 // Shut down any swapped out RenderViewHosts. 65 // Shut down any swapped out RenderViewHosts.
65 for (RenderViewHostMap::iterator iter = swapped_out_hosts_.begin(); 66 for (RenderViewHostMap::iterator iter = swapped_out_hosts_.begin();
66 iter != swapped_out_hosts_.end(); 67 iter != swapped_out_hosts_.end();
67 ++iter) { 68 ++iter) {
68 iter->second->Shutdown(); 69 iter->second->Shutdown();
69 } 70 }
70 } 71 }
71 72
72 void RenderViewHostManager::Init(content::BrowserContext* browser_context, 73 void RenderViewHostManager::Init(content::BrowserContext* browser_context,
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 } 960 }
960 961
961 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost( 962 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost(
962 SiteInstance* instance) { 963 SiteInstance* instance) {
963 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId()); 964 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId());
964 if (iter != swapped_out_hosts_.end()) 965 if (iter != swapped_out_hosts_.end())
965 return iter->second; 966 return iter->second;
966 967
967 return NULL; 968 return NULL;
968 } 969 }
OLDNEW
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698