| 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 zoom_level_changed_callbacks_.Notify(change); | 415 zoom_level_changed_callbacks_.Notify(change); |
| 416 } | 416 } |
| 417 | 417 |
| 418 bool HostZoomMapImpl::PageScaleFactorIsOneForWebContents( | 418 bool HostZoomMapImpl::PageScaleFactorIsOneForWebContents( |
| 419 const WebContentsImpl& web_contents_impl) const { | 419 const WebContentsImpl& web_contents_impl) const { |
| 420 if (!web_contents_impl.GetRenderProcessHost()) | 420 if (!web_contents_impl.GetRenderProcessHost()) |
| 421 return true; | 421 return true; |
| 422 base::AutoLock auto_lock(lock_); | 422 base::AutoLock auto_lock(lock_); |
| 423 auto found = view_page_scale_factors_are_one_.find( | 423 auto found = view_page_scale_factors_are_one_.find( |
| 424 RenderViewKey(web_contents_impl.GetRenderProcessHost()->GetID(), | 424 RenderViewKey(web_contents_impl.GetRenderProcessHost()->GetID(), |
| 425 web_contents_impl.GetRoutingID())); | 425 web_contents_impl.GetRenderViewHost()->GetRoutingID())); |
| 426 if (found == view_page_scale_factors_are_one_.end()) | 426 if (found == view_page_scale_factors_are_one_.end()) |
| 427 return true; | 427 return true; |
| 428 return found->second; | 428 return found->second; |
| 429 } | 429 } |
| 430 | 430 |
| 431 void HostZoomMapImpl::ClearPageScaleFactorIsOneForView(int render_process_id, | 431 void HostZoomMapImpl::ClearPageScaleFactorIsOneForView(int render_process_id, |
| 432 int render_view_id) { | 432 int render_view_id) { |
| 433 base::AutoLock auto_lock(lock_); | 433 base::AutoLock auto_lock(lock_); |
| 434 view_page_scale_factors_are_one_.erase( | 434 view_page_scale_factors_are_one_.erase( |
| 435 RenderViewKey(render_process_id, render_view_id)); | 435 RenderViewKey(render_process_id, render_view_id)); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 double error_page_zoom_level = GetZoomLevelForHost(host); | 551 double error_page_zoom_level = GetZoomLevelForHost(host); |
| 552 | 552 |
| 553 SendZoomLevelChange(std::string(), host, error_page_zoom_level); | 553 SendZoomLevelChange(std::string(), host, error_page_zoom_level); |
| 554 } | 554 } |
| 555 | 555 |
| 556 HostZoomMapImpl::~HostZoomMapImpl() { | 556 HostZoomMapImpl::~HostZoomMapImpl() { |
| 557 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 557 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 558 } | 558 } |
| 559 | 559 |
| 560 } // namespace content | 560 } // namespace content |
| OLD | NEW |