OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |