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/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <utility> | 10 #include <utility> |
(...skipping 3182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3193 // are all aimed at ensuring no such attacker-controlled navigation can | 3193 // are all aimed at ensuring no such attacker-controlled navigation can |
3194 // trigger this. | 3194 // trigger this. |
3195 // | 3195 // |
3196 // Note that we check the pending entry instead of the visible one; for the | 3196 // Note that we check the pending entry instead of the visible one; for the |
3197 // startup URL case these are the same, but for the attacker-controlled | 3197 // startup URL case these are the same, but for the attacker-controlled |
3198 // navigation case the visible entry is the committed "about:blank" URL and | 3198 // navigation case the visible entry is the committed "about:blank" URL and |
3199 // the pending entry is the problematic navigation elsewhere. | 3199 // the pending entry is the problematic navigation elsewhere. |
3200 NavigationEntryImpl* entry = controller_.GetPendingEntry(); | 3200 NavigationEntryImpl* entry = controller_.GetPendingEntry(); |
3201 if (controller_.IsInitialNavigation() && entry && | 3201 if (controller_.IsInitialNavigation() && entry && |
3202 !entry->is_renderer_initiated() && | 3202 !entry->is_renderer_initiated() && |
3203 entry->GetURL() == GURL(url::kAboutBlankURL)) { | 3203 entry->GetURL() == url::kAboutBlankURL) { |
3204 return true; | 3204 return true; |
3205 } | 3205 } |
3206 return delegate_ && delegate_->ShouldFocusLocationBarByDefault(this); | 3206 return delegate_ && delegate_->ShouldFocusLocationBarByDefault(this); |
3207 } | 3207 } |
3208 | 3208 |
3209 void WebContentsImpl::SetFocusToLocationBar(bool select_all) { | 3209 void WebContentsImpl::SetFocusToLocationBar(bool select_all) { |
3210 if (delegate_) | 3210 if (delegate_) |
3211 delegate_->SetFocusToLocationBar(select_all); | 3211 delegate_->SetFocusToLocationBar(select_all); |
3212 } | 3212 } |
3213 | 3213 |
(...skipping 1982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5196 dialog_manager_ = dialog_manager; | 5196 dialog_manager_ = dialog_manager; |
5197 } | 5197 } |
5198 | 5198 |
5199 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { | 5199 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { |
5200 auto it = binding_sets_.find(interface_name); | 5200 auto it = binding_sets_.find(interface_name); |
5201 if (it != binding_sets_.end()) | 5201 if (it != binding_sets_.end()) |
5202 binding_sets_.erase(it); | 5202 binding_sets_.erase(it); |
5203 } | 5203 } |
5204 | 5204 |
5205 } // namespace content | 5205 } // namespace content |
OLD | NEW |