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

Side by Side Diff: Source/modules/navigatorcontentutils/NavigatorContentUtils.h

Issue 1226113002: Move protocol registration from WebViewClient to WebFrameClient, part 2/3. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 | « no previous file | Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp » ('j') | 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) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, Google Inc. All rights reserved.
3 * Copyright (C) 2012, Samsung Electronics. All rights reserved. 3 * Copyright (C) 2012, Samsung Electronics. 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 are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
13 * 13 *
14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE 17 * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
24 * DAMAGE. 24 * DAMAGE.
25 */ 25 */
26 26
27 #ifndef NavigatorContentUtils_h 27 #ifndef NavigatorContentUtils_h
28 #define NavigatorContentUtils_h 28 #define NavigatorContentUtils_h
29 29
30 #include "core/page/Page.h"
31 #include "modules/ModulesExport.h" 30 #include "modules/ModulesExport.h"
32 #include "modules/navigatorcontentutils/NavigatorContentUtilsClient.h" 31 #include "modules/navigatorcontentutils/NavigatorContentUtilsClient.h"
33 #include "platform/Supplementable.h" 32 #include "platform/Supplementable.h"
34 #include "platform/heap/Handle.h" 33 #include "platform/heap/Handle.h"
35 #include "wtf/OwnPtr.h" 34 #include "wtf/OwnPtr.h"
36 #include "wtf/text/WTFString.h" 35 #include "wtf/text/WTFString.h"
37 36
38 namespace blink { 37 namespace blink {
39 38
40 class ExceptionState; 39 class ExceptionState;
40 class LocalFrame;
41 class Navigator; 41 class Navigator;
42 class Page;
43 42
44 class MODULES_EXPORT NavigatorContentUtils final : public NoBaseWillBeGarbageCol lectedFinalized<NavigatorContentUtils>, public WillBeHeapSupplement<Page> { 43 class MODULES_EXPORT NavigatorContentUtils final : public NoBaseWillBeGarbageCol lectedFinalized<NavigatorContentUtils>, public WillBeHeapSupplement<LocalFrame> {
45 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorContentUtils); 44 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorContentUtils);
46 public: 45 public:
47 virtual ~NavigatorContentUtils(); 46 virtual ~NavigatorContentUtils();
48 47
49 static NavigatorContentUtils* from(Page&); 48 static NavigatorContentUtils* from(LocalFrame&);
50 static const char* supplementName(); 49 static const char* supplementName();
51 50
52 static void registerProtocolHandler(Navigator&, const String& scheme, const String& url, const String& title, ExceptionState&); 51 static void registerProtocolHandler(Navigator&, const String& scheme, const String& url, const String& title, ExceptionState&);
53 static String isProtocolHandlerRegistered(Navigator&, const String& scheme, const String& url, ExceptionState&); 52 static String isProtocolHandlerRegistered(Navigator&, const String& scheme, const String& url, ExceptionState&);
54 static void unregisterProtocolHandler(Navigator&, const String& scheme, cons t String& url, ExceptionState&); 53 static void unregisterProtocolHandler(Navigator&, const String& scheme, cons t String& url, ExceptionState&);
55 54
56 static PassOwnPtrWillBeRawPtr<NavigatorContentUtils> create(PassOwnPtr<Navig atorContentUtilsClient>); 55 static PassOwnPtrWillBeRawPtr<NavigatorContentUtils> create(PassOwnPtr<Navig atorContentUtilsClient>);
57 56
58 DEFINE_INLINE_VIRTUAL_TRACE() { WillBeHeapSupplement<Page>::trace(visitor); } 57 DEFINE_INLINE_VIRTUAL_TRACE() { WillBeHeapSupplement<LocalFrame>::trace(visi tor); }
59 58
60 void setClientForTest(PassOwnPtr<NavigatorContentUtilsClient> client) { m_cl ient = client; } 59 void setClientForTest(PassOwnPtr<NavigatorContentUtilsClient> client) { m_cl ient = client; }
61 60
62 private: 61 private:
63 explicit NavigatorContentUtils(PassOwnPtr<NavigatorContentUtilsClient> clien t) 62 explicit NavigatorContentUtils(PassOwnPtr<NavigatorContentUtilsClient> clien t)
64 : m_client(client) 63 : m_client(client)
65 { } 64 { }
66 65
67 NavigatorContentUtilsClient* client() { return m_client.get(); } 66 NavigatorContentUtilsClient* client() { return m_client.get(); }
68 67
69 OwnPtr<NavigatorContentUtilsClient> m_client; 68 OwnPtr<NavigatorContentUtilsClient> m_client;
70 }; 69 };
71 70
72 } // namespace blink 71 } // namespace blink
73 72
74 #endif // NavigatorContentUtils_h 73 #endif // NavigatorContentUtils_h
OLDNEW
« no previous file with comments | « no previous file | Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698