| 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 "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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 // First check whether we're going to want to focus the location bar after | 696 // First check whether we're going to want to focus the location bar after |
| 697 // this commit. We do this now because the navigation hasn't formally | 697 // this commit. We do this now because the navigation hasn't formally |
| 698 // committed yet, so if we've already cleared |pending_web_ui_| the call chain | 698 // committed yet, so if we've already cleared |pending_web_ui_| the call chain |
| 699 // this triggers won't be able to figure out what's going on. | 699 // this triggers won't be able to figure out what's going on. |
| 700 bool will_focus_location_bar = delegate_->FocusLocationBarByDefault(); | 700 bool will_focus_location_bar = delegate_->FocusLocationBarByDefault(); |
| 701 | 701 |
| 702 // Next commit the Web UI, if any. Either replace |web_ui_| with | 702 // Next commit the Web UI, if any. Either replace |web_ui_| with |
| 703 // |pending_web_ui_|, or clear |web_ui_| if there is no pending WebUI, or | 703 // |pending_web_ui_|, or clear |web_ui_| if there is no pending WebUI, or |
| 704 // leave |web_ui_| as is if reusing it. | 704 // leave |web_ui_| as is if reusing it. |
| 705 DCHECK(!(pending_web_ui_.get() && pending_and_current_web_ui_.get())); | 705 DCHECK(!(pending_web_ui_.get() && pending_and_current_web_ui_.get())); |
| 706 if (pending_web_ui_.get()) | 706 if (pending_web_ui_) |
| 707 web_ui_.reset(pending_web_ui_.release()); | 707 web_ui_.reset(pending_web_ui_.release()); |
| 708 else if (!pending_and_current_web_ui_.get()) | 708 else if (!pending_and_current_web_ui_) |
| 709 web_ui_.reset(); | 709 web_ui_.reset(); |
| 710 | 710 |
| 711 // It's possible for the pending_render_view_host_ to be NULL when we aren't | 711 // It's possible for the pending_render_view_host_ to be NULL when we aren't |
| 712 // crossing process boundaries. If so, we just needed to handle the Web UI | 712 // crossing process boundaries. If so, we just needed to handle the Web UI |
| 713 // committing above and we're done. | 713 // committing above and we're done. |
| 714 if (!pending_render_view_host_) { | 714 if (!pending_render_view_host_) { |
| 715 if (will_focus_location_bar) | 715 if (will_focus_location_bar) |
| 716 delegate_->SetFocusToLocationBar(false); | 716 delegate_->SetFocusToLocationBar(false); |
| 717 return; | 717 return; |
| 718 } | 718 } |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost( | 986 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost( |
| 987 SiteInstance* instance) { | 987 SiteInstance* instance) { |
| 988 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId()); | 988 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId()); |
| 989 if (iter != swapped_out_hosts_.end()) | 989 if (iter != swapped_out_hosts_.end()) |
| 990 return iter->second; | 990 return iter->second; |
| 991 | 991 |
| 992 return NULL; | 992 return NULL; |
| 993 } | 993 } |
| 994 | 994 |
| 995 } // namespace content | 995 } // namespace content |
| OLD | NEW |