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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2025 int id = StartDownload(host, url, image_size); | 2025 int id = StartDownload(host, url, image_size); |
2026 favicon_download_map_[id] = callback; | 2026 favicon_download_map_[id] = callback; |
2027 return id; | 2027 return id; |
2028 } | 2028 } |
2029 | 2029 |
2030 bool WebContentsImpl::FocusLocationBarByDefault() { | 2030 bool WebContentsImpl::FocusLocationBarByDefault() { |
2031 WebUI* web_ui = GetWebUIForCurrentState(); | 2031 WebUI* web_ui = GetWebUIForCurrentState(); |
2032 if (web_ui) | 2032 if (web_ui) |
2033 return web_ui->ShouldFocusLocationBarByDefault(); | 2033 return web_ui->ShouldFocusLocationBarByDefault(); |
2034 NavigationEntry* entry = controller_.GetActiveEntry(); | 2034 NavigationEntry* entry = controller_.GetActiveEntry(); |
2035 return (entry && entry->GetURL() == GURL(chrome::kAboutBlankURL)); | 2035 if (entry && entry->GetURL() == GURL(chrome::kAboutBlankURL)) |
| 2036 return true; |
| 2037 return delegate_ && delegate_->ShouldFocusLocationBarByDefault(this); |
2036 } | 2038 } |
2037 | 2039 |
2038 void WebContentsImpl::SetFocusToLocationBar(bool select_all) { | 2040 void WebContentsImpl::SetFocusToLocationBar(bool select_all) { |
2039 if (delegate_) | 2041 if (delegate_) |
2040 delegate_->SetFocusToLocationBar(select_all); | 2042 delegate_->SetFocusToLocationBar(select_all); |
2041 } | 2043 } |
2042 | 2044 |
2043 #if defined(ENABLE_WEB_INTENTS) | 2045 #if defined(ENABLE_WEB_INTENTS) |
2044 void WebContentsImpl::OnRegisterIntentService( | 2046 void WebContentsImpl::OnRegisterIntentService( |
2045 const webkit_glue::WebIntentServiceData& data, | 2047 const webkit_glue::WebIntentServiceData& data, |
(...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3497 | 3499 |
3498 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { | 3500 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { |
3499 return browser_plugin_guest_.get(); | 3501 return browser_plugin_guest_.get(); |
3500 } | 3502 } |
3501 | 3503 |
3502 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const { | 3504 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const { |
3503 return browser_plugin_embedder_.get(); | 3505 return browser_plugin_embedder_.get(); |
3504 } | 3506 } |
3505 | 3507 |
3506 } // namespace content | 3508 } // namespace content |
OLD | NEW |