OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/host_zoom_level_context.h" |
| 6 |
| 7 #include "base/files/file_path.h" |
| 8 #include "content/browser/host_zoom_map_impl.h" |
| 9 #include "content/public/browser/browser_thread.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 HostZoomLevelContext::HostZoomLevelContext( |
| 14 scoped_ptr<ZoomLevelDelegate> zoom_level_delegate, |
| 15 const base::FilePath& file_path) |
| 16 : host_zoom_map_impl_(new HostZoomMapImpl()), |
| 17 zoom_level_delegate_(zoom_level_delegate.release()) { |
| 18 if (zoom_level_delegate_) |
| 19 zoom_level_delegate_->InitPrefsAndCopyToHostZoomMap( |
| 20 file_path, host_zoom_map_impl_.get()); |
| 21 } |
| 22 |
| 23 HostZoomLevelContext::~HostZoomLevelContext() {} |
| 24 |
| 25 void HostZoomLevelContext::DeleteOnCorrectThread() const { |
| 26 if (BrowserThread::IsMessageLoopValid(BrowserThread::UI) && |
| 27 !BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
| 28 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, this); |
| 29 return; |
| 30 } |
| 31 delete this; |
| 32 } |
| 33 |
| 34 } // namespace content |
OLD | NEW |