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

Side by Side Diff: Source/modules/vibration/NavigatorVibration.cpp

Issue 19641006: Cancel vibration when frame load is committed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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
« no previous file with comments | « Source/modules/vibration/NavigatorVibration.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Samsung Electronics 2 * Copyright (C) 2012 Samsung Electronics
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 m_pattern.remove(0); 121 m_pattern.remove(0);
122 } 122 }
123 } 123 }
124 124
125 void NavigatorVibration::pageVisibilityChanged() 125 void NavigatorVibration::pageVisibilityChanged()
126 { 126 {
127 if (page()->visibilityState() != PageVisibilityStateVisible) 127 if (page()->visibilityState() != PageVisibilityStateVisible)
128 cancelVibration(); 128 cancelVibration();
129 } 129 }
130 130
131 void NavigatorVibration::didCommitLoad(Frame* frame)
132 {
133 // A new load has been committed, which means the current page will be
134 // unloaded. Cancel all running vibrations.
135 cancelVibration();
136 }
137
131 bool NavigatorVibration::vibrate(Navigator* navigator, unsigned time) 138 bool NavigatorVibration::vibrate(Navigator* navigator, unsigned time)
132 { 139 {
133 VibrationPattern pattern; 140 VibrationPattern pattern;
134 pattern.append(time); 141 pattern.append(time);
135 return NavigatorVibration::vibrate(navigator, pattern); 142 return NavigatorVibration::vibrate(navigator, pattern);
136 } 143 }
137 144
138 bool NavigatorVibration::vibrate(Navigator* navigator, const VibrationPattern& p attern) 145 bool NavigatorVibration::vibrate(Navigator* navigator, const VibrationPattern& p attern)
139 { 146 {
140 Page* page = navigator->frame()->page(); 147 Page* page = navigator->frame()->page();
(...skipping 15 matching lines...) Expand all
156 } 163 }
157 return navigatorVibration; 164 return navigatorVibration;
158 } 165 }
159 166
160 const char* NavigatorVibration::supplementName() 167 const char* NavigatorVibration::supplementName()
161 { 168 {
162 return "NavigatorVibration"; 169 return "NavigatorVibration";
163 } 170 }
164 171
165 } // namespace WebCore 172 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/vibration/NavigatorVibration.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698