OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R
ights Reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R
ights Reserved. |
3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 { | 272 { |
273 HistoryItem* item = backForward()->forwardItem(); | 273 HistoryItem* item = backForward()->forwardItem(); |
274 | 274 |
275 if (item) { | 275 if (item) { |
276 goToItem(item); | 276 goToItem(item); |
277 return true; | 277 return true; |
278 } | 278 } |
279 return false; | 279 return false; |
280 } | 280 } |
281 | 281 |
282 bool Page::canGoBackOrForward(int distance) const | |
283 { | |
284 if (distance == 0) | |
285 return true; | |
286 if (distance > 0 && distance <= backForward()->forwardCount()) | |
287 return true; | |
288 if (distance < 0 && -distance <= backForward()->backCount()) | |
289 return true; | |
290 return false; | |
291 } | |
292 | |
293 void Page::goBackOrForward(int distance) | 282 void Page::goBackOrForward(int distance) |
294 { | 283 { |
295 if (distance == 0) | 284 if (distance == 0) |
296 return; | 285 return; |
297 | 286 |
298 HistoryItem* item = backForward()->itemAtIndex(distance); | 287 HistoryItem* item = backForward()->itemAtIndex(distance); |
299 if (!item) { | 288 if (!item) { |
300 if (distance > 0) { | 289 if (distance > 0) { |
301 if (int forwardCount = backForward()->forwardCount()) | 290 if (int forwardCount = backForward()->forwardCount()) |
302 item = backForward()->itemAtIndex(forwardCount); | 291 item = backForward()->itemAtIndex(forwardCount); |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 , dragClient(0) | 827 , dragClient(0) |
839 , inspectorClient(0) | 828 , inspectorClient(0) |
840 { | 829 { |
841 } | 830 } |
842 | 831 |
843 Page::PageClients::~PageClients() | 832 Page::PageClients::~PageClients() |
844 { | 833 { |
845 } | 834 } |
846 | 835 |
847 } // namespace WebCore | 836 } // namespace WebCore |
OLD | NEW |