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

Side by Side Diff: content/browser/device_orientation/message_filter.cc

Issue 10755002: Refactors DeviceOrientation to make it more extensible (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Small changes to appease try bots Created 8 years, 4 months 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/browser/device_orientation/message_filter.h"
6
7 #include "content/browser/device_orientation/observer_delegate.h"
8 #include "content/browser/device_orientation/provider.h"
9 #include "content/public/browser/browser_thread.h"
10
11 using content::BrowserThread;
12
13 namespace device_orientation {
14
15 MessageFilter::MessageFilter(DeviceData::Type device_data_type)
16 : provider_(NULL),
17 device_data_type_(device_data_type) {
18 }
19
20 MessageFilter::~MessageFilter() {
21 }
22
23 void MessageFilter::OnStartUpdating(int render_view_id) {
24 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
25
26 if (!provider_)
27 provider_ = Provider::GetInstance();
28
29 observers_map_[render_view_id] = new ObserverDelegate(device_data_type_,
30 provider_, render_view_id, this);
31 }
32
33 void MessageFilter::OnStopUpdating(int render_view_id) {
34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
35
36 observers_map_.erase(render_view_id);
37 }
38
39 } // namespace device_orientation
OLDNEW
« no previous file with comments | « content/browser/device_orientation/message_filter.h ('k') | content/browser/device_orientation/observer_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698