Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1145233002: Revert of Change WebContents::last_active_time_ to Time instead of Timeticks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 displayed_insecure_content_(false), 314 displayed_insecure_content_(false),
315 has_accessed_initial_document_(false), 315 has_accessed_initial_document_(false),
316 theme_color_(SK_ColorTRANSPARENT), 316 theme_color_(SK_ColorTRANSPARENT),
317 last_sent_theme_color_(SK_ColorTRANSPARENT), 317 last_sent_theme_color_(SK_ColorTRANSPARENT),
318 capturer_count_(0), 318 capturer_count_(0),
319 should_normally_be_visible_(true), 319 should_normally_be_visible_(true),
320 is_being_destroyed_(false), 320 is_being_destroyed_(false),
321 notify_disconnection_(false), 321 notify_disconnection_(false),
322 dialog_manager_(NULL), 322 dialog_manager_(NULL),
323 is_showing_before_unload_dialog_(false), 323 is_showing_before_unload_dialog_(false),
324 last_active_time_(base::Time::Now()), 324 last_active_time_(base::TimeTicks::Now()),
325 closed_by_user_gesture_(false), 325 closed_by_user_gesture_(false),
326 minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)), 326 minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)),
327 maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)), 327 maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)),
328 render_view_message_source_(NULL), 328 render_view_message_source_(NULL),
329 render_frame_message_source_(NULL), 329 render_frame_message_source_(NULL),
330 fullscreen_widget_routing_id_(MSG_ROUTING_NONE), 330 fullscreen_widget_routing_id_(MSG_ROUTING_NONE),
331 fullscreen_widget_had_focus_at_shutdown_(false), 331 fullscreen_widget_had_focus_at_shutdown_(false),
332 is_subframe_(false), 332 is_subframe_(false),
333 force_disable_overscroll_content_(false), 333 force_disable_overscroll_content_(false),
334 last_dialog_suppressed_(false), 334 last_dialog_suppressed_(false),
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 CreateAudioPowerSaveBlocker(); 1046 CreateAudioPowerSaveBlocker();
1047 } else { 1047 } else {
1048 audio_power_save_blocker_.reset(); 1048 audio_power_save_blocker_.reset();
1049 } 1049 }
1050 } 1050 }
1051 1051
1052 if (delegate_) 1052 if (delegate_)
1053 delegate_->NavigationStateChanged(this, changed_flags); 1053 delegate_->NavigationStateChanged(this, changed_flags);
1054 } 1054 }
1055 1055
1056 base::Time WebContentsImpl::GetLastActiveTime() const { 1056 base::TimeTicks WebContentsImpl::GetLastActiveTime() const {
1057 return last_active_time_; 1057 return last_active_time_;
1058 } 1058 }
1059 1059
1060 void WebContentsImpl::WasShown() { 1060 void WebContentsImpl::WasShown() {
1061 controller_.SetActive(true); 1061 controller_.SetActive(true);
1062 1062
1063 for (RenderWidgetHostView* view : GetRenderWidgetHostViewsInTree()) { 1063 for (RenderWidgetHostView* view : GetRenderWidgetHostViewsInTree()) {
1064 if (view) { 1064 if (view) {
1065 view->Show(); 1065 view->Show();
1066 #if defined(OS_MACOSX) 1066 #if defined(OS_MACOSX)
1067 view->SetActive(true); 1067 view->SetActive(true);
1068 #endif 1068 #endif
1069 } 1069 }
1070 } 1070 }
1071 1071
1072 last_active_time_ = base::Time::Now(); 1072 last_active_time_ = base::TimeTicks::Now();
1073 1073
1074 // The resize rect might have changed while this was inactive -- send the new 1074 // The resize rect might have changed while this was inactive -- send the new
1075 // one to make sure it's up to date. 1075 // one to make sure it's up to date.
1076 RenderViewHostImpl* rvh = GetRenderViewHost(); 1076 RenderViewHostImpl* rvh = GetRenderViewHost();
1077 if (rvh) 1077 if (rvh)
1078 rvh->ResizeRectChanged(GetRootWindowResizerRect()); 1078 rvh->ResizeRectChanged(GetRootWindowResizerRect());
1079 1079
1080 // Restore power save blocker if there are active video players running. 1080 // Restore power save blocker if there are active video players running.
1081 if (!active_video_players_.empty() && !video_power_save_blocker_) 1081 if (!active_video_players_.empty() && !video_power_save_blocker_)
1082 CreateVideoPowerSaveBlocker(); 1082 CreateVideoPowerSaveBlocker();
(...skipping 3348 matching lines...) Expand 10 before | Expand all | Expand 10 after
4431 node->render_manager()->ResumeResponseDeferredAtStart(); 4431 node->render_manager()->ResumeResponseDeferredAtStart();
4432 } 4432 }
4433 4433
4434 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4434 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4435 force_disable_overscroll_content_ = force_disable; 4435 force_disable_overscroll_content_ = force_disable;
4436 if (view_) 4436 if (view_)
4437 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4437 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4438 } 4438 }
4439 4439
4440 } // namespace content 4440 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/browser/web_contents/web_contents_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698