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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/process/process.h" | 13 #include "base/process/process.h" |
| 14 #include "base/profiler/scoped_tracker.h" |
14 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
15 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
17 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
18 #include "base/time/time.h" | 19 #include "base/time/time.h" |
19 #include "base/trace_event/trace_event.h" | 20 #include "base/trace_event/trace_event.h" |
20 #include "content/browser/accessibility/accessibility_mode_helper.h" | 21 #include "content/browser/accessibility/accessibility_mode_helper.h" |
21 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 22 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
22 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 23 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
23 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 24 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 base::TerminationStatus WebContentsImpl::GetCrashedStatus() const { | 1046 base::TerminationStatus WebContentsImpl::GetCrashedStatus() const { |
1046 return crashed_status_; | 1047 return crashed_status_; |
1047 } | 1048 } |
1048 | 1049 |
1049 bool WebContentsImpl::IsBeingDestroyed() const { | 1050 bool WebContentsImpl::IsBeingDestroyed() const { |
1050 return is_being_destroyed_; | 1051 return is_being_destroyed_; |
1051 } | 1052 } |
1052 | 1053 |
1053 void WebContentsImpl::NotifyNavigationStateChanged( | 1054 void WebContentsImpl::NotifyNavigationStateChanged( |
1054 InvalidateTypes changed_flags) { | 1055 InvalidateTypes changed_flags) { |
| 1056 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285 |
| 1057 // is fixed. |
| 1058 tracked_objects::ScopedTracker tracking_profile( |
| 1059 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 1060 "466285 WebContentsImpl::NotifyNavigationStateChanged")); |
1055 // Create and release the audio power save blocker depending on whether the | 1061 // Create and release the audio power save blocker depending on whether the |
1056 // tab is actively producing audio or not. | 1062 // tab is actively producing audio or not. |
1057 if ((changed_flags & INVALIDATE_TYPE_TAB) && | 1063 if ((changed_flags & INVALIDATE_TYPE_TAB) && |
1058 audio_state_provider_->IsAudioStateAvailable()) { | 1064 audio_state_provider_->IsAudioStateAvailable()) { |
1059 if (WasRecentlyAudible()) { | 1065 if (WasRecentlyAudible()) { |
1060 if (!audio_power_save_blocker_) | 1066 if (!audio_power_save_blocker_) |
1061 CreateAudioPowerSaveBlocker(); | 1067 CreateAudioPowerSaveBlocker(); |
1062 } else { | 1068 } else { |
1063 audio_power_save_blocker_.reset(); | 1069 audio_power_save_blocker_.reset(); |
1064 } | 1070 } |
(...skipping 3117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4182 void WebContentsImpl::RendererResponsive(RenderViewHost* render_view_host) { | 4188 void WebContentsImpl::RendererResponsive(RenderViewHost* render_view_host) { |
4183 if (delegate_) | 4189 if (delegate_) |
4184 delegate_->RendererResponsive(this); | 4190 delegate_->RendererResponsive(this); |
4185 } | 4191 } |
4186 | 4192 |
4187 void WebContentsImpl::LoadStateChanged( | 4193 void WebContentsImpl::LoadStateChanged( |
4188 const GURL& url, | 4194 const GURL& url, |
4189 const net::LoadStateWithParam& load_state, | 4195 const net::LoadStateWithParam& load_state, |
4190 uint64 upload_position, | 4196 uint64 upload_position, |
4191 uint64 upload_size) { | 4197 uint64 upload_size) { |
| 4198 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285 |
| 4199 // is fixed. |
| 4200 tracked_objects::ScopedTracker tracking_profile1( |
| 4201 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 4202 "466285 WebContentsImpl::LoadStateChanged::Start")); |
4192 load_state_ = load_state; | 4203 load_state_ = load_state; |
4193 upload_position_ = upload_position; | 4204 upload_position_ = upload_position; |
4194 upload_size_ = upload_size; | 4205 upload_size_ = upload_size; |
4195 load_state_host_ = net::IDNToUnicode(url.host(), | 4206 load_state_host_ = net::IDNToUnicode(url.host(), |
4196 GetContentClient()->browser()->GetAcceptLangs( | 4207 GetContentClient()->browser()->GetAcceptLangs( |
4197 GetBrowserContext())); | 4208 GetBrowserContext())); |
4198 if (load_state_.state == net::LOAD_STATE_READING_RESPONSE) | 4209 if (load_state_.state == net::LOAD_STATE_READING_RESPONSE) |
4199 SetNotWaitingForResponse(); | 4210 SetNotWaitingForResponse(); |
4200 if (IsLoading()) { | 4211 if (IsLoading()) { |
4201 NotifyNavigationStateChanged(static_cast<InvalidateTypes>( | 4212 NotifyNavigationStateChanged(static_cast<InvalidateTypes>( |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4585 node->render_manager()->ResumeResponseDeferredAtStart(); | 4596 node->render_manager()->ResumeResponseDeferredAtStart(); |
4586 } | 4597 } |
4587 | 4598 |
4588 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4599 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4589 force_disable_overscroll_content_ = force_disable; | 4600 force_disable_overscroll_content_ = force_disable; |
4590 if (view_) | 4601 if (view_) |
4591 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4602 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4592 } | 4603 } |
4593 | 4604 |
4594 } // namespace content | 4605 } // namespace content |
OLD | NEW |