| OLD | NEW |
| 1 // Copyright (c) 2012 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 "content/browser/host_zoom_map_impl.h" | 5 #include "content/browser/host_zoom_map_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 double HostZoomMapImpl::GetDefaultZoomLevel() const { | 274 double HostZoomMapImpl::GetDefaultZoomLevel() const { |
| 275 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 275 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 276 return default_zoom_level_; | 276 return default_zoom_level_; |
| 277 } | 277 } |
| 278 | 278 |
| 279 void HostZoomMapImpl::SetDefaultZoomLevel(double level) { | 279 void HostZoomMapImpl::SetDefaultZoomLevel(double level) { |
| 280 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 280 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 281 default_zoom_level_ = level; | 281 default_zoom_level_ = level; |
| 282 } | 282 } |
| 283 | 283 |
| 284 scoped_ptr<HostZoomMap::Subscription> | 284 std::unique_ptr<HostZoomMap::Subscription> |
| 285 HostZoomMapImpl::AddZoomLevelChangedCallback( | 285 HostZoomMapImpl::AddZoomLevelChangedCallback( |
| 286 const ZoomLevelChangedCallback& callback) { | 286 const ZoomLevelChangedCallback& callback) { |
| 287 return zoom_level_changed_callbacks_.Add(callback); | 287 return zoom_level_changed_callbacks_.Add(callback); |
| 288 } | 288 } |
| 289 | 289 |
| 290 double HostZoomMapImpl::GetZoomLevelForWebContents( | 290 double HostZoomMapImpl::GetZoomLevelForWebContents( |
| 291 const WebContentsImpl& web_contents_impl) const { | 291 const WebContentsImpl& web_contents_impl) const { |
| 292 int render_process_id = web_contents_impl.GetRenderProcessHost()->GetID(); | 292 int render_process_id = web_contents_impl.GetRenderProcessHost()->GetID(); |
| 293 int routing_id = web_contents_impl.GetRenderViewHost()->GetRoutingID(); | 293 int routing_id = web_contents_impl.GetRenderViewHost()->GetRoutingID(); |
| 294 | 294 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 double error_page_zoom_level = GetZoomLevelForHost(host); | 490 double error_page_zoom_level = GetZoomLevelForHost(host); |
| 491 | 491 |
| 492 SendZoomLevelChange(std::string(), host, error_page_zoom_level); | 492 SendZoomLevelChange(std::string(), host, error_page_zoom_level); |
| 493 } | 493 } |
| 494 | 494 |
| 495 HostZoomMapImpl::~HostZoomMapImpl() { | 495 HostZoomMapImpl::~HostZoomMapImpl() { |
| 496 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 496 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 497 } | 497 } |
| 498 | 498 |
| 499 } // namespace content | 499 } // namespace content |
| OLD | NEW |