| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 | 174 |
| 175 void ThumbnailGenerator::MonitorRenderer(RenderWidgetHost* renderer, | 175 void ThumbnailGenerator::MonitorRenderer(RenderWidgetHost* renderer, |
| 176 bool monitor) { | 176 bool monitor) { |
| 177 Source<RenderWidgetHost> renderer_source = Source<RenderWidgetHost>(renderer); | 177 Source<RenderWidgetHost> renderer_source = Source<RenderWidgetHost>(renderer); |
| 178 bool currently_monitored = | 178 bool currently_monitored = |
| 179 registrar_.IsRegistered( | 179 registrar_.IsRegistered( |
| 180 this, | 180 this, |
| 181 NotificationType::RENDER_WIDGET_HOST_WILL_DESTROY_BACKING_STORE, | 181 NotificationType::RENDER_WIDGET_HOST_WILL_DESTROY_BACKING_STORE, |
| 182 renderer_source); | 182 renderer_source); |
| 183 if (monitor |= currently_monitored) { | 183 if (monitor != currently_monitored) { |
| 184 if (monitor) { | 184 if (monitor) { |
| 185 registrar_.Add( | 185 registrar_.Add( |
| 186 this, | 186 this, |
| 187 NotificationType::RENDER_WIDGET_HOST_WILL_DESTROY_BACKING_STORE, | 187 NotificationType::RENDER_WIDGET_HOST_WILL_DESTROY_BACKING_STORE, |
| 188 renderer_source); | 188 renderer_source); |
| 189 registrar_.Add( | 189 registrar_.Add( |
| 190 this, | 190 this, |
| 191 NotificationType::RENDER_WIDGET_HOST_DID_UPDATE_BACKING_STORE, | 191 NotificationType::RENDER_WIDGET_HOST_DID_UPDATE_BACKING_STORE, |
| 192 renderer_source); | 192 renderer_source); |
| 193 registrar_.Add( | 193 registrar_.Add( |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 &ThumbnailGenerator::ShownDelayHandler); | 527 &ThumbnailGenerator::ShownDelayHandler); |
| 528 } | 528 } |
| 529 } | 529 } |
| 530 | 530 |
| 531 void ThumbnailGenerator::EraseHostFromShownList(RenderWidgetHost* widget) { | 531 void ThumbnailGenerator::EraseHostFromShownList(RenderWidgetHost* widget) { |
| 532 std::vector<RenderWidgetHost*>::iterator found = | 532 std::vector<RenderWidgetHost*>::iterator found = |
| 533 std::find(shown_hosts_.begin(), shown_hosts_.end(), widget); | 533 std::find(shown_hosts_.begin(), shown_hosts_.end(), widget); |
| 534 if (found != shown_hosts_.end()) | 534 if (found != shown_hosts_.end()) |
| 535 shown_hosts_.erase(found); | 535 shown_hosts_.erase(found); |
| 536 } | 536 } |
| OLD | NEW |