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/renderer_host/render_widget_host_view_gtk.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_gtk.h" |
6 | 6 |
7 // If this gets included after the gtk headers, then a bunch of compiler | 7 // If this gets included after the gtk headers, then a bunch of compiler |
8 // errors happen because of a "#define Status int" in Xlib.h, which interacts | 8 // errors happen because of a "#define Status int" in Xlib.h, which interacts |
9 // badly with net::URLRequestStatus::Status. | 9 // badly with net::URLRequestStatus::Status. |
10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 | 637 |
638 content::RenderWidgetHost* | 638 content::RenderWidgetHost* |
639 RenderWidgetHostViewGtk::GetRenderWidgetHost() const { | 639 RenderWidgetHostViewGtk::GetRenderWidgetHost() const { |
640 return host_; | 640 return host_; |
641 } | 641 } |
642 | 642 |
643 void RenderWidgetHostViewGtk::DidBecomeSelected() { | 643 void RenderWidgetHostViewGtk::DidBecomeSelected() { |
644 if (!is_hidden_) | 644 if (!is_hidden_) |
645 return; | 645 return; |
646 | 646 |
647 if (tab_switch_paint_time_.is_null()) | 647 if (web_contents_switch_paint_time_.is_null()) |
648 tab_switch_paint_time_ = base::TimeTicks::Now(); | 648 web_contents_switch_paint_time_ = base::TimeTicks::Now(); |
649 is_hidden_ = false; | 649 is_hidden_ = false; |
650 host_->WasRestored(); | 650 host_->WasRestored(); |
651 } | 651 } |
652 | 652 |
653 void RenderWidgetHostViewGtk::WasHidden() { | 653 void RenderWidgetHostViewGtk::WasHidden() { |
654 if (is_hidden_) | 654 if (is_hidden_) |
655 return; | 655 return; |
656 | 656 |
657 // If we receive any more paint messages while we are hidden, we want to | 657 // If we receive any more paint messages while we are hidden, we want to |
658 // ignore them so we don't re-allocate the backing store. We will paint | 658 // ignore them so we don't re-allocate the backing store. We will paint |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 } | 1099 } |
1100 if (!whiteout_start_time_.is_null()) { | 1100 if (!whiteout_start_time_.is_null()) { |
1101 base::TimeDelta whiteout_duration = base::TimeTicks::Now() - | 1101 base::TimeDelta whiteout_duration = base::TimeTicks::Now() - |
1102 whiteout_start_time_; | 1102 whiteout_start_time_; |
1103 UMA_HISTOGRAM_TIMES("MPArch.RWHH_WhiteoutDuration", whiteout_duration); | 1103 UMA_HISTOGRAM_TIMES("MPArch.RWHH_WhiteoutDuration", whiteout_duration); |
1104 | 1104 |
1105 // Reset the start time to 0 so that we start recording again the next | 1105 // Reset the start time to 0 so that we start recording again the next |
1106 // time the backing store is NULL... | 1106 // time the backing store is NULL... |
1107 whiteout_start_time_ = base::TimeTicks(); | 1107 whiteout_start_time_ = base::TimeTicks(); |
1108 } | 1108 } |
1109 if (!tab_switch_paint_time_.is_null()) { | 1109 if (!web_contents_switch_paint_time_.is_null()) { |
1110 base::TimeDelta tab_switch_paint_duration = base::TimeTicks::Now() - | 1110 base::TimeDelta web_contents_switch_paint_duration = |
1111 tab_switch_paint_time_; | 1111 base::TimeTicks::Now() - web_contents_switch_paint_time_; |
1112 UMA_HISTOGRAM_TIMES("MPArch.RWH_TabSwitchPaintDuration", | 1112 UMA_HISTOGRAM_TIMES("MPArch.RWH_TabSwitchPaintDuration", |
1113 tab_switch_paint_duration); | 1113 web_contents_switch_paint_duration); |
1114 // Reset tab_switch_paint_time_ to 0 so future tab selections are | 1114 // Reset web_contents_switch_paint_time_ to 0 so future tab selections are |
1115 // recorded. | 1115 // recorded. |
1116 tab_switch_paint_time_ = base::TimeTicks(); | 1116 web_contents_switch_paint_time_ = base::TimeTicks(); |
1117 } | 1117 } |
1118 } else { | 1118 } else { |
1119 if (window) | 1119 if (window) |
1120 gdk_window_clear(window); | 1120 gdk_window_clear(window); |
1121 if (whiteout_start_time_.is_null()) | 1121 if (whiteout_start_time_.is_null()) |
1122 whiteout_start_time_ = base::TimeTicks::Now(); | 1122 whiteout_start_time_ = base::TimeTicks::Now(); |
1123 } | 1123 } |
1124 } | 1124 } |
1125 | 1125 |
1126 void RenderWidgetHostViewGtk::ShowCurrentCursor() { | 1126 void RenderWidgetHostViewGtk::ShowCurrentCursor() { |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1380 return new RenderWidgetHostViewGtk(widget); | 1380 return new RenderWidgetHostViewGtk(widget); |
1381 } | 1381 } |
1382 | 1382 |
1383 // static | 1383 // static |
1384 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | 1384 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
1385 WebKit::WebScreenInfo* results) { | 1385 WebKit::WebScreenInfo* results) { |
1386 GdkWindow* gdk_window = | 1386 GdkWindow* gdk_window = |
1387 gdk_display_get_default_group(gdk_display_get_default()); | 1387 gdk_display_get_default_group(gdk_display_get_default()); |
1388 content::GetScreenInfoFromNativeWindow(gdk_window, results); | 1388 content::GetScreenInfoFromNativeWindow(gdk_window, results); |
1389 } | 1389 } |
OLD | NEW |