| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 void checkNavigationPolicy(const ResourceRequest&, DocumentLoader*, PassRefP
tr<FormState>, NavigationPolicyDecisionFunction, void* argument); | 53 void checkNavigationPolicy(const ResourceRequest&, DocumentLoader*, PassRefP
tr<FormState>, NavigationPolicyDecisionFunction, void* argument); |
| 54 void checkNavigationPolicy(const ResourceRequest&, NavigationPolicyDecisionF
unction, void* argument); | 54 void checkNavigationPolicy(const ResourceRequest&, NavigationPolicyDecisionF
unction, void* argument); |
| 55 void checkNewWindowPolicy(const NavigationAction&, NewWindowPolicyDecisionFu
nction, const ResourceRequest&, PassRefPtr<FormState>, const String& frameName,
void* argument); | 55 void checkNewWindowPolicy(const NavigationAction&, NewWindowPolicyDecisionFu
nction, const ResourceRequest&, PassRefPtr<FormState>, const String& frameName,
void* argument); |
| 56 void checkContentPolicy(const ResourceResponse&, ContentPolicyDecisionFuncti
on, void* argument); | 56 void checkContentPolicy(const ResourceResponse&, ContentPolicyDecisionFuncti
on, void* argument); |
| 57 | 57 |
| 58 // FIXME: These are different. They could use better names. | 58 // FIXME: These are different. They could use better names. |
| 59 void cancelCheck(); | 59 void cancelCheck(); |
| 60 void stopCheck(); | 60 void stopCheck(); |
| 61 | 61 |
| 62 void cannotShowMIMEType(const ResourceResponse&); | |
| 63 | |
| 64 FrameLoadType loadType() const { return m_loadType; } | 62 FrameLoadType loadType() const { return m_loadType; } |
| 65 void setLoadType(FrameLoadType loadType) { m_loadType = loadType; } | 63 void setLoadType(FrameLoadType loadType) { m_loadType = loadType; } |
| 66 | 64 |
| 67 bool delegateIsDecidingNavigationPolicy() const { return m_delegateIsDecidin
gNavigationPolicy; } | 65 bool delegateIsDecidingNavigationPolicy() const { return m_delegateIsDecidin
gNavigationPolicy; } |
| 68 bool delegateIsHandlingUnimplementablePolicy() const { return m_delegateIsHa
ndlingUnimplementablePolicy; } | 66 bool delegateIsHandlingUnimplementablePolicy() const { return m_delegateIsHa
ndlingUnimplementablePolicy; } |
| 69 | 67 |
| 70 // FIXME: This function is a cheat. Basically, this is just an asynchronouc
callback | 68 // FIXME: This function is a cheat. Basically, this is just an asynchronouc
callback |
| 71 // from the FrameLoaderClient, but this callback uses the policy types and s
o has to | 69 // from the FrameLoaderClient, but this callback uses the policy types and s
o has to |
| 72 // live on this object. In the long term, we should create a type for non-p
olicy | 70 // live on this object. In the long term, we should create a type for non-p
olicy |
| 73 // callbacks from the FrameLoaderClient and remove this vestige. I just don
't have | 71 // callbacks from the FrameLoaderClient and remove this vestige. I just don
't have |
| 74 // the heart to hack on all the platforms to make that happen right now. | 72 // the heart to hack on all the platforms to make that happen right now. |
| 75 void continueLoadAfterWillSubmitForm(PolicyAction); | 73 void continueLoadAfterWillSubmitForm(PolicyAction); |
| 76 | 74 |
| 77 private: | 75 private: |
| 78 void continueAfterNavigationPolicy(PolicyAction); | 76 void continueAfterNavigationPolicy(PolicyAction); |
| 79 void continueAfterNewWindowPolicy(PolicyAction); | 77 void continueAfterNewWindowPolicy(PolicyAction); |
| 80 void continueAfterContentPolicy(PolicyAction); | 78 void continueAfterContentPolicy(PolicyAction); |
| 81 | 79 |
| 82 void handleUnimplementablePolicy(const ResourceError&); | |
| 83 | |
| 84 Frame* m_frame; | 80 Frame* m_frame; |
| 85 | 81 |
| 86 bool m_delegateIsDecidingNavigationPolicy; | 82 bool m_delegateIsDecidingNavigationPolicy; |
| 87 bool m_delegateIsHandlingUnimplementablePolicy; | 83 bool m_delegateIsHandlingUnimplementablePolicy; |
| 88 | 84 |
| 89 // This identifies the type of navigation action which prompted this load. N
ote | 85 // This identifies the type of navigation action which prompted this load. N
ote |
| 90 // that WebKit conveys this value as the WebActionNavigationTypeKey value | 86 // that WebKit conveys this value as the WebActionNavigationTypeKey value |
| 91 // on navigation action delegate callbacks. | 87 // on navigation action delegate callbacks. |
| 92 FrameLoadType m_loadType; | 88 FrameLoadType m_loadType; |
| 93 PolicyCallback m_callback; | 89 PolicyCallback m_callback; |
| 94 }; | 90 }; |
| 95 | 91 |
| 96 } // namespace WebCore | 92 } // namespace WebCore |
| 97 | 93 |
| 98 #endif // PolicyChecker_h | 94 #endif // PolicyChecker_h |
| OLD | NEW |