OLD | NEW |
1 // Copyright (c) 2011 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 <cmath> | 5 #include <cmath> |
6 | 6 |
7 #include "content/browser/host_zoom_map_impl.h" | 7 #include "content/browser/host_zoom_map_impl.h" |
8 | 8 |
9 #include "base/string_piece.h" | 9 #include "base/string_piece.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 | 157 |
158 void HostZoomMapImpl::Observe( | 158 void HostZoomMapImpl::Observe( |
159 int type, | 159 int type, |
160 const content::NotificationSource& source, | 160 const content::NotificationSource& source, |
161 const content::NotificationDetails& details) { | 161 const content::NotificationDetails& details) { |
162 switch (type) { | 162 switch (type) { |
163 case content::NOTIFICATION_RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW: { | 163 case content::NOTIFICATION_RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW: { |
164 base::AutoLock auto_lock(lock_); | 164 base::AutoLock auto_lock(lock_); |
165 int render_view_id = | 165 int render_view_id = |
166 content::Source<RenderViewHost>(source)->routing_id(); | 166 content::Source<RenderViewHost>(source)->GetRoutingID(); |
167 int render_process_id = | 167 int render_process_id = |
168 content::Source<RenderViewHost>(source)->process()->GetID(); | 168 content::Source<RenderViewHost>(source)->GetProcess()->GetID(); |
169 | 169 |
170 for (size_t i = 0; i < temporary_zoom_levels_.size(); ++i) { | 170 for (size_t i = 0; i < temporary_zoom_levels_.size(); ++i) { |
171 if (temporary_zoom_levels_[i].render_process_id == render_process_id && | 171 if (temporary_zoom_levels_[i].render_process_id == render_process_id && |
172 temporary_zoom_levels_[i].render_view_id == render_view_id) { | 172 temporary_zoom_levels_[i].render_view_id == render_view_id) { |
173 temporary_zoom_levels_.erase(temporary_zoom_levels_.begin() + i); | 173 temporary_zoom_levels_.erase(temporary_zoom_levels_.begin() + i); |
174 break; | 174 break; |
175 } | 175 } |
176 } | 176 } |
177 break; | 177 break; |
178 } | 178 } |
179 default: | 179 default: |
180 NOTREACHED() << "Unexpected preference observed."; | 180 NOTREACHED() << "Unexpected preference observed."; |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 HostZoomMapImpl::~HostZoomMapImpl() { | 184 HostZoomMapImpl::~HostZoomMapImpl() { |
185 } | 185 } |
OLD | NEW |