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_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
8 #include <OpenGL/gl.h> | 8 #include <OpenGL/gl.h> |
9 #include <QuartzCore/QuartzCore.h> | 9 #include <QuartzCore/QuartzCore.h> |
10 | 10 |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 render_widget_host_->WasShown(renderer_latency_info); | 938 render_widget_host_->WasShown(renderer_latency_info); |
939 } | 939 } |
940 | 940 |
941 void RenderWidgetHostViewMac::WasOccluded() { | 941 void RenderWidgetHostViewMac::WasOccluded() { |
942 if (render_widget_host_->is_hidden()) | 942 if (render_widget_host_->is_hidden()) |
943 return; | 943 return; |
944 | 944 |
945 // Note that the following call to WasHidden() can trigger thumbnail | 945 // Note that the following call to WasHidden() can trigger thumbnail |
946 // generation on behalf of the NTP, and that cannot succeed if the browser | 946 // generation on behalf of the NTP, and that cannot succeed if the browser |
947 // compositor view has been suspended. Therefore these two statements must | 947 // compositor view has been suspended. Therefore these two statements must |
948 // occur in this specific order. However, because thumbnail generation is | 948 // occur in this specific order. |
949 // asychronous, that operation won't run before SuspendBrowserCompositorView() | |
950 // completes. As a result you won't get a thumbnail for the page unless you | |
951 // happen to switch back to it. See http://crbug.com/530707 . | |
952 render_widget_host_->WasHidden(); | 949 render_widget_host_->WasHidden(); |
953 SuspendBrowserCompositorView(); | 950 SuspendBrowserCompositorView(); |
954 } | 951 } |
955 | 952 |
956 void RenderWidgetHostViewMac::SetSize(const gfx::Size& size) { | 953 void RenderWidgetHostViewMac::SetSize(const gfx::Size& size) { |
957 gfx::Rect rect = GetViewBounds(); | 954 gfx::Rect rect = GetViewBounds(); |
958 rect.set_size(size); | 955 rect.set_size(size); |
959 SetBounds(rect); | 956 SetBounds(rect); |
960 } | 957 } |
961 | 958 |
(...skipping 2447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3409 | 3406 |
3410 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3407 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3411 // regions that are not draggable. (See ControlRegionView in | 3408 // regions that are not draggable. (See ControlRegionView in |
3412 // native_app_window_cocoa.mm). This requires the render host view to be | 3409 // native_app_window_cocoa.mm). This requires the render host view to be |
3413 // draggable by default. | 3410 // draggable by default. |
3414 - (BOOL)mouseDownCanMoveWindow { | 3411 - (BOOL)mouseDownCanMoveWindow { |
3415 return YES; | 3412 return YES; |
3416 } | 3413 } |
3417 | 3414 |
3418 @end | 3415 @end |
OLD | NEW |