
The two methods converged over the last year and are now equivalent. Bug: 825054 Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs Change-Id: I4ec5f7afb5b7b21278af6c777efe9ad57d2aae68 Reviewed-on: https://chromium-review.googlesource.com/977063 Reviewed-by: John Abd-El-Malek <jam@chromium.org> Commit-Queue: Gabriel Charette <gab@chromium.org> Cr-Commit-Position: refs/heads/master@{#546529}
35 lines
1.0 KiB
C++
35 lines
1.0 KiB
C++
// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "content/browser/host_zoom_level_context.h"
|
|
|
|
#include <utility>
|
|
|
|
#include "base/files/file_path.h"
|
|
#include "content/browser/host_zoom_map_impl.h"
|
|
#include "content/public/browser/browser_thread.h"
|
|
|
|
namespace content {
|
|
|
|
HostZoomLevelContext::HostZoomLevelContext(
|
|
std::unique_ptr<ZoomLevelDelegate> zoom_level_delegate)
|
|
: host_zoom_map_impl_(new HostZoomMapImpl()),
|
|
zoom_level_delegate_(std::move(zoom_level_delegate)) {
|
|
if (zoom_level_delegate_)
|
|
zoom_level_delegate_->InitHostZoomMap(host_zoom_map_impl_.get());
|
|
}
|
|
|
|
HostZoomLevelContext::~HostZoomLevelContext() {}
|
|
|
|
void HostZoomLevelContext::DeleteOnCorrectThread() const {
|
|
if (BrowserThread::IsThreadInitialized(BrowserThread::UI) &&
|
|
!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
|
|
BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, this);
|
|
return;
|
|
}
|
|
delete this;
|
|
}
|
|
|
|
} // namespace content
|