Chromium Code Reviews| 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 : host_zoom_map_impl_(new HostZoomMapImpl()), | |
| 16 zoom_level_delegate_(zoom_level_delegate.release()) { | |
|
boliu
2014/11/11 21:47:11
s/release/Pass/
wjmaclean
2014/11/12 15:12:55
Done.
| |
| 17 if (zoom_level_delegate_) | |
| 18 zoom_level_delegate_->InitHostZoomMap(host_zoom_map_impl_.get()); | |
| 19 } | |
| 20 | |
| 21 HostZoomLevelContext::~HostZoomLevelContext() {} | |
| 22 | |
| 23 void HostZoomLevelContext::DeleteOnCorrectThread() const { | |
| 24 if (BrowserThread::IsMessageLoopValid(BrowserThread::UI) && | |
| 25 !BrowserThread::CurrentlyOn(BrowserThread::UI)) { | |
| 26 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, this); | |
| 27 return; | |
| 28 } | |
| 29 delete this; | |
| 30 } | |
| 31 | |
| 32 } // namespace content | |
| OLD | NEW |