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

Side by Side Diff: chrome/browser/tab_contents/thumbnail_generator.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix other os's Created 8 years, 2 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 | Annotate | Revision Log
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 "chrome/browser/tab_contents/thumbnail_generator.h" 5 #include "chrome/browser/tab_contents/thumbnail_generator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 break; 121 break;
122 } 122 }
123 return copy_size; 123 return copy_size;
124 } 124 }
125 125
126 // Returns the size of the thumbnail stored in the database in pixel. 126 // Returns the size of the thumbnail stored in the database in pixel.
127 gfx::Size GetThumbnailSizeInPixel() { 127 gfx::Size GetThumbnailSizeInPixel() {
128 gfx::Size thumbnail_size(kThumbnailWidth, kThumbnailHeight); 128 gfx::Size thumbnail_size(kThumbnailWidth, kThumbnailHeight);
129 // Determine the resolution of the thumbnail based on the primary monitor. 129 // Determine the resolution of the thumbnail based on the primary monitor.
130 // TODO(oshima): Use device's default scale factor. 130 // TODO(oshima): Use device's default scale factor.
131 gfx::Display primary_display = gfx::Screen::GetPrimaryDisplay(); 131 gfx::Display primary_display = gfx::Screen::GetPrimaryDisplay(
132 gfx::Screen::BadTwoWorldsContext());
132 return thumbnail_size.Scale(primary_display.device_scale_factor()); 133 return thumbnail_size.Scale(primary_display.device_scale_factor());
133 } 134 }
134 135
135 // Returns the clipping rectangle that is used for creating a thumbnail with 136 // Returns the clipping rectangle that is used for creating a thumbnail with
136 // the size of |desired_size| from the bitmap with the size of |source_size|. 137 // the size of |desired_size| from the bitmap with the size of |source_size|.
137 // The type of clipping that needs to be done is assigned to |clip_result|. 138 // The type of clipping that needs to be done is assigned to |clip_result|.
138 gfx::Rect GetClippingRect(const gfx::Size& source_size, 139 gfx::Rect GetClippingRect(const gfx::Size& source_size,
139 const gfx::Size& desired_size, 140 const gfx::Size& desired_size,
140 ThumbnailGenerator::ClipResult* clip_result) { 141 ThumbnailGenerator::ClipResult* clip_result) {
141 DCHECK(clip_result); 142 DCHECK(clip_result);
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 void ThumbnailGenerator::DidStartLoading( 638 void ThumbnailGenerator::DidStartLoading(
638 content::RenderViewHost* render_view_host) { 639 content::RenderViewHost* render_view_host) {
639 load_interrupted_ = false; 640 load_interrupted_ = false;
640 } 641 }
641 642
642 void ThumbnailGenerator::StopNavigation() { 643 void ThumbnailGenerator::StopNavigation() {
643 // This function gets called when the page loading is interrupted by the 644 // This function gets called when the page loading is interrupted by the
644 // stop button. 645 // stop button.
645 load_interrupted_ = true; 646 load_interrupted_ = true;
646 } 647 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698