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 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2011 int id = StartDownload(host, url, image_size); | 2011 int id = StartDownload(host, url, image_size); |
2012 favicon_download_map_[id] = callback; | 2012 favicon_download_map_[id] = callback; |
2013 return id; | 2013 return id; |
2014 } | 2014 } |
2015 | 2015 |
2016 bool WebContentsImpl::FocusLocationBarByDefault() { | 2016 bool WebContentsImpl::FocusLocationBarByDefault() { |
2017 WebUI* web_ui = GetWebUIForCurrentState(); | 2017 WebUI* web_ui = GetWebUIForCurrentState(); |
2018 if (web_ui) | 2018 if (web_ui) |
2019 return web_ui->ShouldFocusLocationBarByDefault(); | 2019 return web_ui->ShouldFocusLocationBarByDefault(); |
2020 NavigationEntry* entry = controller_.GetActiveEntry(); | 2020 NavigationEntry* entry = controller_.GetActiveEntry(); |
2021 return (entry && entry->GetURL() == GURL(chrome::kAboutBlankURL)); | 2021 if (entry && entry->GetURL() == GURL(chrome::kAboutBlankURL)) |
| 2022 return true; |
| 2023 return delegate_ && delegate_->ShouldFocusLocationBarByDefault(this); |
2022 } | 2024 } |
2023 | 2025 |
2024 void WebContentsImpl::SetFocusToLocationBar(bool select_all) { | 2026 void WebContentsImpl::SetFocusToLocationBar(bool select_all) { |
2025 if (delegate_) | 2027 if (delegate_) |
2026 delegate_->SetFocusToLocationBar(select_all); | 2028 delegate_->SetFocusToLocationBar(select_all); |
2027 } | 2029 } |
2028 | 2030 |
2029 #if defined(ENABLE_WEB_INTENTS) | 2031 #if defined(ENABLE_WEB_INTENTS) |
2030 void WebContentsImpl::OnRegisterIntentService( | 2032 void WebContentsImpl::OnRegisterIntentService( |
2031 const webkit_glue::WebIntentServiceData& data, | 2033 const webkit_glue::WebIntentServiceData& data, |
(...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3483 | 3485 |
3484 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { | 3486 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { |
3485 return browser_plugin_guest_.get(); | 3487 return browser_plugin_guest_.get(); |
3486 } | 3488 } |
3487 | 3489 |
3488 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const { | 3490 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const { |
3489 return browser_plugin_embedder_.get(); | 3491 return browser_plugin_embedder_.get(); |
3490 } | 3492 } |
3491 | 3493 |
3492 } // namespace content | 3494 } // namespace content |
OLD | NEW |