Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: content/browser/host_zoom_level_context.cc

Issue 393133002: Migrate HostZoomMap to live in StoragePartition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit tests. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698