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

Side by Side Diff: chrome/browser/ui/cocoa/tabpose_window.mm

Issue 6010004: Refactor RenderWidgetHost::set_paint_observer() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comments Created 10 years 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #import "chrome/browser/ui/cocoa/tabpose_window.h" 5 #import "chrome/browser/ui/cocoa/tabpose_window.h"
6 6
7 #import <QuartzCore/QuartzCore.h> 7 #import <QuartzCore/QuartzCore.h>
8 8
9 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "base/mac_util.h" 10 #include "base/mac_util.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 ResetPaintingObserver(); 109 ResetPaintingObserver();
110 } 110 }
111 111
112 void DidReceiveBitmap(const SkBitmap& bitmap) { 112 void DidReceiveBitmap(const SkBitmap& bitmap) {
113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
114 ResetPaintingObserver(); 114 ResetPaintingObserver();
115 [layer_ setThumbnail:bitmap]; 115 [layer_ setThumbnail:bitmap];
116 } 116 }
117 117
118 void ResetPaintingObserver() { 118 void ResetPaintingObserver() {
119 if (rwh_->painting_observer() != NULL) { 119 g_browser_process->GetThumbnailGenerator()->MonitorRenderer(rwh_, false);
120 DCHECK(rwh_->painting_observer() ==
121 g_browser_process->GetThumbnailGenerator());
122 rwh_->set_painting_observer(NULL);
123 }
124 } 120 }
125 121
126 gfx::Size size_; 122 gfx::Size size_;
127 RenderWidgetHost* rwh_; // weak 123 RenderWidgetHost* rwh_; // weak
128 ThumbnailLayer* layer_; // weak, owns us 124 ThumbnailLayer* layer_; // weak, owns us
129 base::ScopedCallbackFactory<ThumbnailLoader> factory_; 125 base::ScopedCallbackFactory<ThumbnailLoader> factory_;
130 126
131 DISALLOW_COPY_AND_ASSIGN(ThumbnailLoader); 127 DISALLOW_COPY_AND_ASSIGN(ThumbnailLoader);
132 }; 128 };
133 129
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 tile.set_tab_contents(contents->tab_contents()); 1541 tile.set_tab_contents(contents->tab_contents());
1546 ThumbnailLayer* thumbLayer = [allThumbnailLayers_ objectAtIndex:index]; 1542 ThumbnailLayer* thumbLayer = [allThumbnailLayers_ objectAtIndex:index];
1547 [thumbLayer setTabContents:contents->tab_contents()]; 1543 [thumbLayer setTabContents:contents->tab_contents()];
1548 } 1544 }
1549 1545
1550 - (void)tabStripModelDeleted { 1546 - (void)tabStripModelDeleted {
1551 [self close]; 1547 [self close];
1552 } 1548 }
1553 1549
1554 @end 1550 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698