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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 params->set_prompt(true); | 2058 params->set_prompt(true); |
2059 dlm->DownloadUrl(params.Pass()); | 2059 dlm->DownloadUrl(params.Pass()); |
2060 } | 2060 } |
2061 | 2061 |
2062 void WebContentsImpl::GenerateMHTML( | 2062 void WebContentsImpl::GenerateMHTML( |
2063 const base::FilePath& file, | 2063 const base::FilePath& file, |
2064 const base::Callback<void(int64)>& callback) { | 2064 const base::Callback<void(int64)>& callback) { |
2065 MHTMLGenerationManager::GetInstance()->SaveMHTML(this, file, callback); | 2065 MHTMLGenerationManager::GetInstance()->SaveMHTML(this, file, callback); |
2066 } | 2066 } |
2067 | 2067 |
2068 // TODO(nasko): Rename this method to IsVisibleEntry. | |
2069 bool WebContentsImpl::IsActiveEntry(int32 page_id) { | |
2070 NavigationEntryImpl* visible_entry = | |
2071 NavigationEntryImpl::FromNavigationEntry(controller_.GetVisibleEntry()); | |
2072 return (visible_entry != NULL && | |
2073 visible_entry->site_instance() == GetSiteInstance() && | |
2074 visible_entry->GetPageID() == page_id); | |
2075 } | |
2076 | |
2077 const std::string& WebContentsImpl::GetContentsMimeType() const { | 2068 const std::string& WebContentsImpl::GetContentsMimeType() const { |
2078 return contents_mime_type_; | 2069 return contents_mime_type_; |
2079 } | 2070 } |
2080 | 2071 |
2081 bool WebContentsImpl::WillNotifyDisconnection() const { | 2072 bool WebContentsImpl::WillNotifyDisconnection() const { |
2082 return notify_disconnection_; | 2073 return notify_disconnection_; |
2083 } | 2074 } |
2084 | 2075 |
2085 void WebContentsImpl::SetOverrideEncoding(const std::string& encoding) { | 2076 void WebContentsImpl::SetOverrideEncoding(const std::string& encoding) { |
2086 SetEncoding(encoding); | 2077 SetEncoding(encoding); |
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4088 | 4079 |
4089 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 4080 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
4090 if (!delegate_) | 4081 if (!delegate_) |
4091 return; | 4082 return; |
4092 const gfx::Size new_size = GetPreferredSize(); | 4083 const gfx::Size new_size = GetPreferredSize(); |
4093 if (new_size != old_size) | 4084 if (new_size != old_size) |
4094 delegate_->UpdatePreferredSize(this, new_size); | 4085 delegate_->UpdatePreferredSize(this, new_size); |
4095 } | 4086 } |
4096 | 4087 |
4097 } // namespace content | 4088 } // namespace content |
OLD | NEW |