OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Apple Inc. All rights reserved. | 2 * Copyright 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above copyright | 10 * * Redistributions in binary form must reproduce the above copyright |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 if (m_timer.isActive()) | 95 if (m_timer.isActive()) |
96 m_timer.stop(); | 96 m_timer.stop(); |
97 | 97 |
98 unregisterWithDispatcher(); | 98 unregisterWithDispatcher(); |
99 m_isActive = false; | 99 m_isActive = false; |
100 } | 100 } |
101 | 101 |
102 void DeviceSensorEventController::pageVisibilityChanged() | 102 void DeviceSensorEventController::pageVisibilityChanged() |
103 { | 103 { |
104 if (!m_hasEventListener) | 104 if (page()->visibilityState() == PageVisibilityStateVisible && m_hasEventLis
tener) |
105 return; | |
106 | |
107 if (page()->visibilityState() == PageVisibilityStateVisible) | |
108 startUpdating(); | 105 startUpdating(); |
109 else | 106 else if (page()->visibilityState() == PageVisibilityStateHidden) |
110 stopUpdating(); | 107 stopUpdating(); |
111 } | 108 } |
112 | 109 |
113 } // namespace WebCore | 110 } // namespace WebCore |
OLD | NEW |