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

Side by Side Diff: chrome/browser/tab_contents/tab_util.cc

Issue 115704: Change URL back to the previous one if the typed URL causes file download.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 7 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/tab_contents/tab_contents.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/tab_contents/tab_util.h" 5 #include "chrome/browser/tab_contents/tab_util.h"
6 6
7 #include "chrome/browser/renderer_host/render_process_host.h" 7 #include "chrome/browser/renderer_host/render_process_host.h"
8 #include "chrome/browser/renderer_host/render_view_host.h" 8 #include "chrome/browser/renderer_host/render_view_host.h"
9 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" 9 #include "chrome/browser/renderer_host/resource_dispatcher_host.h"
10 #include "chrome/browser/tab_contents/tab_contents.h" 10 #include "chrome/browser/tab_contents/tab_contents.h"
(...skipping 11 matching lines...) Expand all
22 if (!info) 22 if (!info)
23 return false; 23 return false;
24 24
25 *render_process_id = info->process_id; 25 *render_process_id = info->process_id;
26 *render_view_id = info->route_id; 26 *render_view_id = info->route_id;
27 return true; 27 return true;
28 } 28 }
29 29
30 TabContents* tab_util::GetTabContentsByID(int render_process_id, 30 TabContents* tab_util::GetTabContentsByID(int render_process_id,
31 int render_view_id) { 31 int render_view_id) {
32 // Ensures that that this method is only ever called on the UI thread.
33
34 // TODO(yuzo): Fix the callers and uncomment the following.
35 // DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type());
36
32 RenderViewHost* render_view_host = 37 RenderViewHost* render_view_host =
33 RenderViewHost::FromID(render_process_id, render_view_id); 38 RenderViewHost::FromID(render_process_id, render_view_id);
34 if (!render_view_host) 39 if (!render_view_host)
35 return NULL; 40 return NULL;
36 41
37 return render_view_host->delegate()->GetAsTabContents(); 42 return render_view_host->delegate()->GetAsTabContents();
38 } 43 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698