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

Side by Side Diff: Source/core/frame/Navigator.cpp

Issue 879423003: Move Location to DOMWindow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Harri Porten (porten@kde.org) 2 * Copyright (C) 2000 Harri Porten (porten@kde.org)
3 * Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org) 3 * Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org)
4 * Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org) 4 * Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. 5 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 String Navigator::vendorSub() const 73 String Navigator::vendorSub() const
74 { 74 {
75 return WEBCORE_NAVIGATOR_VENDOR_SUB; 75 return WEBCORE_NAVIGATOR_VENDOR_SUB;
76 } 76 }
77 77
78 String Navigator::userAgent() const 78 String Navigator::userAgent() const
79 { 79 {
80 // If the frame is already detached it no longer has a meaningful useragent. 80 // If the frame is already detached it no longer has a meaningful useragent.
81 if (!m_frame || !m_frame->page()) 81 if (!localFrame() || !m_frame->page())
82 return String(); 82 return String();
83 83
84 return m_frame->loader().userAgent(m_frame->document()->url()); 84 return localFrame()->loader().userAgent(localFrame()->document()->url());
85 } 85 }
86 86
87 DOMPluginArray* Navigator::plugins() const 87 DOMPluginArray* Navigator::plugins() const
88 { 88 {
89 if (!m_plugins) 89 if (!m_plugins)
90 m_plugins = DOMPluginArray::create(m_frame); 90 m_plugins = DOMPluginArray::create(localFrame());
91 return m_plugins.get(); 91 return m_plugins.get();
92 } 92 }
93 93
94 DOMMimeTypeArray* Navigator::mimeTypes() const 94 DOMMimeTypeArray* Navigator::mimeTypes() const
95 { 95 {
96 if (!m_mimeTypes) 96 if (!m_mimeTypes)
97 m_mimeTypes = DOMMimeTypeArray::create(m_frame); 97 m_mimeTypes = DOMMimeTypeArray::create(localFrame());
98 return m_mimeTypes.get(); 98 return m_mimeTypes.get();
99 } 99 }
100 100
101 bool Navigator::cookieEnabled() const 101 bool Navigator::cookieEnabled() const
102 { 102 {
103 if (!m_frame) 103 if (!localFrame())
104 return false; 104 return false;
105 105
106 Settings* settings = m_frame->settings(); 106 Settings* settings = m_frame->settings();
107 if (!settings || !settings->cookieEnabled()) 107 if (!settings || !settings->cookieEnabled())
108 return false; 108 return false;
109 109
110 return cookiesEnabled(m_frame->document()); 110 return cookiesEnabled(localFrame()->document());
111 } 111 }
112 112
113 bool Navigator::javaEnabled() const 113 bool Navigator::javaEnabled() const
114 { 114 {
115 if (!m_frame || !m_frame->settings()) 115 if (!m_frame || !m_frame->settings())
116 return false; 116 return false;
117 117
118 if (!m_frame->settings()->javaEnabled()) 118 if (!m_frame->settings()->javaEnabled())
119 return false; 119 return false;
120 120
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 { 155 {
156 #if ENABLE(OILPAN) 156 #if ENABLE(OILPAN)
157 visitor->trace(m_plugins); 157 visitor->trace(m_plugins);
158 visitor->trace(m_mimeTypes); 158 visitor->trace(m_mimeTypes);
159 HeapSupplementable<Navigator>::trace(visitor); 159 HeapSupplementable<Navigator>::trace(visitor);
160 #endif 160 #endif
161 DOMWindowProperty::trace(visitor); 161 DOMWindowProperty::trace(visitor);
162 } 162 }
163 163
164 } // namespace blink 164 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698