OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 7 #include "content/browser/host_zoom_map.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" |
12 #include "content/browser/renderer_host/render_process_host.h" | 12 #include "content/browser/renderer_host/render_process_host_impl.h" |
13 #include "content/browser/renderer_host/render_view_host.h" | 13 #include "content/browser/renderer_host/render_view_host.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 #include "content/public/browser/notification_service.h" | 15 #include "content/public/browser/notification_service.h" |
16 #include "content/public/browser/notification_types.h" | 16 #include "content/public/browser/notification_types.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
18 #include "net/base/net_util.h" | 18 #include "net/base/net_util.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
20 | 20 |
21 using content::BrowserThread; | 21 using content::BrowserThread; |
22 using WebKit::WebView; | 22 using WebKit::WebView; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 const content::NotificationSource& source, | 121 const content::NotificationSource& source, |
122 const content::NotificationDetails& details) { | 122 const content::NotificationDetails& details) { |
123 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 123 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
124 | 124 |
125 switch (type) { | 125 switch (type) { |
126 case content::NOTIFICATION_RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW: { | 126 case content::NOTIFICATION_RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW: { |
127 base::AutoLock auto_lock(lock_); | 127 base::AutoLock auto_lock(lock_); |
128 int render_view_id = | 128 int render_view_id = |
129 content::Source<RenderViewHost>(source)->routing_id(); | 129 content::Source<RenderViewHost>(source)->routing_id(); |
130 int render_process_id = | 130 int render_process_id = |
131 content::Source<RenderViewHost>(source)->process()->id(); | 131 content::Source<RenderViewHost>(source)->process()->GetID(); |
132 | 132 |
133 for (size_t i = 0; i < temporary_zoom_levels_.size(); ++i) { | 133 for (size_t i = 0; i < temporary_zoom_levels_.size(); ++i) { |
134 if (temporary_zoom_levels_[i].render_process_id == render_process_id && | 134 if (temporary_zoom_levels_[i].render_process_id == render_process_id && |
135 temporary_zoom_levels_[i].render_view_id == render_view_id) { | 135 temporary_zoom_levels_[i].render_view_id == render_view_id) { |
136 temporary_zoom_levels_.erase(temporary_zoom_levels_.begin() + i); | 136 temporary_zoom_levels_.erase(temporary_zoom_levels_.begin() + i); |
137 break; | 137 break; |
138 } | 138 } |
139 } | 139 } |
140 break; | 140 break; |
141 } | 141 } |
142 default: | 142 default: |
143 NOTREACHED() << "Unexpected preference observed."; | 143 NOTREACHED() << "Unexpected preference observed."; |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 HostZoomMap::~HostZoomMap() { | 147 HostZoomMap::~HostZoomMap() { |
148 } | 148 } |
OLD | NEW |