OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. 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 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 #else | 108 #else |
109 // We can't use RefCountedSupplement because that would try to make InternalSett
ings RefCounted | 109 // We can't use RefCountedSupplement because that would try to make InternalSett
ings RefCounted |
110 // and InternalSettings is already RefCounted via its base class, InternalSettin
gsGenerated. | 110 // and InternalSettings is already RefCounted via its base class, InternalSettin
gsGenerated. |
111 // Instead, we manually make InternalSettings supplement Page. | 111 // Instead, we manually make InternalSettings supplement Page. |
112 class InternalSettingsWrapper : public Supplement<Page> { | 112 class InternalSettingsWrapper : public Supplement<Page> { |
113 public: | 113 public: |
114 explicit InternalSettingsWrapper(Page& page) | 114 explicit InternalSettingsWrapper(Page& page) |
115 : m_internalSettings(InternalSettings::create(page)) { } | 115 : m_internalSettings(InternalSettings::create(page)) { } |
116 virtual ~InternalSettingsWrapper() { m_internalSettings->hostDestroyed(); } | 116 virtual ~InternalSettingsWrapper() { m_internalSettings->hostDestroyed(); } |
117 #if ENABLE(ASSERT) | 117 #if ENABLE(ASSERT) |
118 virtual bool isRefCountedWrapper() const OVERRIDE { return true; } | 118 virtual bool isRefCountedWrapper() const override { return true; } |
119 #endif | 119 #endif |
120 InternalSettings* internalSettings() const { return m_internalSettings.get()
; } | 120 InternalSettings* internalSettings() const { return m_internalSettings.get()
; } |
121 | 121 |
122 private: | 122 private: |
123 RefPtr<InternalSettings> m_internalSettings; | 123 RefPtr<InternalSettings> m_internalSettings; |
124 }; | 124 }; |
125 | 125 |
126 InternalSettings* InternalSettings::from(Page& page) | 126 InternalSettings* InternalSettings::from(Page& page) |
127 { | 127 { |
128 if (!Supplement<Page>::from(page, supplementName())) | 128 if (!Supplement<Page>::from(page, supplementName())) |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 hoverType = HoverTypeOnDemand; | 434 hoverType = HoverTypeOnDemand; |
435 else if (token == "hover") | 435 else if (token == "hover") |
436 hoverType = HoverTypeHover; | 436 hoverType = HoverTypeHover; |
437 else | 437 else |
438 exceptionState.throwDOMException(SyntaxError, "The hover type token ('"
+ token + ")' is invalid."); | 438 exceptionState.throwDOMException(SyntaxError, "The hover type token ('"
+ token + ")' is invalid."); |
439 | 439 |
440 settings()->setPrimaryHoverType(hoverType); | 440 settings()->setPrimaryHoverType(hoverType); |
441 } | 441 } |
442 | 442 |
443 } | 443 } |
OLD | NEW |