| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 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 | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 NavigatorDoNotTrack::NavigatorDoNotTrack(LocalFrame* frame) | 40 NavigatorDoNotTrack::NavigatorDoNotTrack(LocalFrame* frame) |
| 41 : DOMWindowProperty(frame) | 41 : DOMWindowProperty(frame) |
| 42 { | 42 { |
| 43 } | 43 } |
| 44 | 44 |
| 45 NavigatorDoNotTrack::~NavigatorDoNotTrack() | 45 NavigatorDoNotTrack::~NavigatorDoNotTrack() |
| 46 { | 46 { |
| 47 } | 47 } |
| 48 | 48 |
| 49 void NavigatorDoNotTrack::trace(Visitor* visitor) |
| 50 { |
| 51 WillBeHeapSupplement<Navigator>::trace(visitor); |
| 52 DOMWindowProperty::trace(visitor); |
| 53 } |
| 54 |
| 49 const char* NavigatorDoNotTrack::supplementName() | 55 const char* NavigatorDoNotTrack::supplementName() |
| 50 { | 56 { |
| 51 return "NavigatorDoNotTrack"; | 57 return "NavigatorDoNotTrack"; |
| 52 } | 58 } |
| 53 | 59 |
| 54 NavigatorDoNotTrack& NavigatorDoNotTrack::from(Navigator& navigator) | 60 NavigatorDoNotTrack& NavigatorDoNotTrack::from(Navigator& navigator) |
| 55 { | 61 { |
| 56 NavigatorDoNotTrack* supplement = static_cast<NavigatorDoNotTrack*>(WillBeHe
apSupplement<Navigator>::from(navigator, supplementName())); | 62 NavigatorDoNotTrack* supplement = static_cast<NavigatorDoNotTrack*>(WillBeHe
apSupplement<Navigator>::from(navigator, supplementName())); |
| 57 if (!supplement) { | 63 if (!supplement) { |
| 58 supplement = new NavigatorDoNotTrack(navigator.frame()); | 64 supplement = new NavigatorDoNotTrack(navigator.frame()); |
| 59 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement)); | 65 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement)); |
| 60 } | 66 } |
| 61 return *supplement; | 67 return *supplement; |
| 62 } | 68 } |
| 63 | 69 |
| 64 String NavigatorDoNotTrack::doNotTrack(Navigator& navigator) | 70 String NavigatorDoNotTrack::doNotTrack(Navigator& navigator) |
| 65 { | 71 { |
| 66 return NavigatorDoNotTrack::from(navigator).doNotTrack(); | 72 return NavigatorDoNotTrack::from(navigator).doNotTrack(); |
| 67 } | 73 } |
| 68 | 74 |
| 69 String NavigatorDoNotTrack::doNotTrack() | 75 String NavigatorDoNotTrack::doNotTrack() |
| 70 { | 76 { |
| 71 if (!frame() || !frame()->loader().client()) | 77 if (!frame() || !frame()->loader().client()) |
| 72 return String(); | 78 return String(); |
| 73 return frame()->loader().client()->doNotTrackValue(); | 79 return frame()->loader().client()->doNotTrackValue(); |
| 74 } | 80 } |
| 75 | 81 |
| 76 } // namespace blink | 82 } // namespace blink |
| OLD | NEW |