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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 1348833003: Fix NTP thumbnail generation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor ThumbnailingContext from struct to class. Created 5 years, 1 month 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/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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 void RenderWidgetHostViewMac::WasOccluded() { 945 void RenderWidgetHostViewMac::WasOccluded() {
946 if (render_widget_host_->is_hidden()) 946 if (render_widget_host_->is_hidden())
947 return; 947 return;
948 948
949 // Note that the following call to WasHidden() can trigger thumbnail 949 // Note that the following call to WasHidden() can trigger thumbnail
950 // generation on behalf of the NTP, and that cannot succeed if the browser 950 // generation on behalf of the NTP, and that cannot succeed if the browser
951 // compositor view has been suspended. Therefore these two statements must 951 // compositor view has been suspended. Therefore these two statements must
952 // occur in this specific order. However, because thumbnail generation is 952 // occur in this specific order. However, because thumbnail generation is
953 // asychronous, that operation won't run before SuspendBrowserCompositorView() 953 // asychronous, that operation won't run before SuspendBrowserCompositorView()
954 // completes. As a result you won't get a thumbnail for the page unless you 954 // completes. As a result you won't get a thumbnail for the page unless you
955 // happen to switch back to it. See http://crbug.com/530707 . 955 // occur in this specific order.
Lei Zhang 2015/11/02 22:41:30 This sentence sounds funny.
shrike 2015/11/03 18:36:23 Sorry about that (big typo).
956 render_widget_host_->WasHidden(); 956 render_widget_host_->WasHidden();
957 SuspendBrowserCompositorView(); 957 SuspendBrowserCompositorView();
958 } 958 }
959 959
960 void RenderWidgetHostViewMac::SetSize(const gfx::Size& size) { 960 void RenderWidgetHostViewMac::SetSize(const gfx::Size& size) {
961 gfx::Rect rect = GetViewBounds(); 961 gfx::Rect rect = GetViewBounds();
962 rect.set_size(size); 962 rect.set_size(size);
963 SetBounds(rect); 963 SetBounds(rect);
964 } 964 }
965 965
(...skipping 2523 matching lines...) Expand 10 before | Expand all | Expand 10 after
3489 3489
3490 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3490 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3491 // regions that are not draggable. (See ControlRegionView in 3491 // regions that are not draggable. (See ControlRegionView in
3492 // native_app_window_cocoa.mm). This requires the render host view to be 3492 // native_app_window_cocoa.mm). This requires the render host view to be
3493 // draggable by default. 3493 // draggable by default.
3494 - (BOOL)mouseDownCanMoveWindow { 3494 - (BOOL)mouseDownCanMoveWindow {
3495 return YES; 3495 return YES;
3496 } 3496 }
3497 3497
3498 @end 3498 @end
OLDNEW
« chrome/browser/thumbnails/thumbnailing_context_unittest.cc ('K') | « chrome/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698