| OLD | NEW |
| 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 "chrome/browser/tab_contents/tab_util.h" | 5 #include "chrome/browser/tab_contents/tab_util.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 9 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| 11 #include "content/public/browser/render_view_host.h" | 11 #include "content/public/browser/render_view_host.h" |
| 12 #include "content/public/browser/render_view_host_delegate.h" | 12 #include "content/public/browser/render_view_host_delegate.h" |
| 13 #include "content/public/browser/site_instance.h" | 13 #include "content/public/browser/site_instance.h" |
| 14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 16 | 16 |
| 17 using content::RenderViewHost; |
| 17 using content::SiteInstance; | 18 using content::SiteInstance; |
| 18 using content::WebContents; | 19 using content::WebContents; |
| 19 | 20 |
| 20 namespace tab_util { | 21 namespace tab_util { |
| 21 | 22 |
| 22 content::WebContents* GetWebContentsByID(int render_process_id, | 23 content::WebContents* GetWebContentsByID(int render_process_id, |
| 23 int render_view_id) { | 24 int render_view_id) { |
| 24 RenderViewHost* render_view_host = | 25 RenderViewHost* render_view_host = |
| 25 RenderViewHost::FromID(render_process_id, render_view_id); | 26 RenderViewHost::FromID(render_process_id, render_view_id); |
| 26 if (!render_view_host) | 27 if (!render_view_host) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 50 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessPerTab) && | 51 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessPerTab) && |
| 51 SiteInstance::IsSameWebSite(source_contents->GetBrowserContext(), | 52 SiteInstance::IsSameWebSite(source_contents->GetBrowserContext(), |
| 52 source_contents->GetURL(), | 53 source_contents->GetURL(), |
| 53 url)) { | 54 url)) { |
| 54 return source_contents->GetSiteInstance(); | 55 return source_contents->GetSiteInstance(); |
| 55 } | 56 } |
| 56 return NULL; | 57 return NULL; |
| 57 } | 58 } |
| 58 | 59 |
| 59 } // namespace tab_util | 60 } // namespace tab_util |
| OLD | NEW |