OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 void InspectorFrontendHost::disconnectClient() | 139 void InspectorFrontendHost::disconnectClient() |
140 { | 140 { |
141 m_client = 0; | 141 m_client = 0; |
142 if (m_menuProvider) | 142 if (m_menuProvider) |
143 m_menuProvider->disconnect(); | 143 m_menuProvider->disconnect(); |
144 m_frontendPage = nullptr; | 144 m_frontendPage = nullptr; |
145 } | 145 } |
146 | 146 |
147 void InspectorFrontendHost::setZoomFactor(float zoom) | 147 void InspectorFrontendHost::setZoomFactor(float zoom) |
148 { | 148 { |
149 if (!m_frontendPage) | |
pfeldman
2014/09/06 10:30:29
Why does this get called after disconnectClient?
dgozman
2014/09/06 10:36:27
That's a reasonable question. The answer is: I don
pfeldman
2014/09/06 10:42:29
Could this be due to microtasks that are dispatchi
| |
150 return; | |
149 if (LocalFrame* frame = m_frontendPage->deprecatedLocalMainFrame()) | 151 if (LocalFrame* frame = m_frontendPage->deprecatedLocalMainFrame()) |
150 frame->setPageAndTextZoomFactors(zoom, 1); | 152 frame->setPageAndTextZoomFactors(zoom, 1); |
151 } | 153 } |
152 | 154 |
153 float InspectorFrontendHost::zoomFactor() | 155 float InspectorFrontendHost::zoomFactor() |
154 { | 156 { |
157 if (!m_frontendPage) | |
158 return 1; | |
155 if (LocalFrame* frame = m_frontendPage->deprecatedLocalMainFrame()) | 159 if (LocalFrame* frame = m_frontendPage->deprecatedLocalMainFrame()) |
156 return frame->pageZoomFactor(); | 160 return frame->pageZoomFactor(); |
157 return 1; | 161 return 1; |
158 } | 162 } |
159 | 163 |
160 void InspectorFrontendHost::setInjectedScriptForOrigin(const String& origin, con st String& script) | 164 void InspectorFrontendHost::setInjectedScriptForOrigin(const String& origin, con st String& script) |
161 { | 165 { |
166 if (!m_frontendPage) | |
167 return; | |
162 m_frontendPage->inspectorController().setInjectedScriptForOrigin(origin, scr ipt); | 168 m_frontendPage->inspectorController().setInjectedScriptForOrigin(origin, scr ipt); |
163 } | 169 } |
164 | 170 |
165 void InspectorFrontendHost::copyText(const String& text) | 171 void InspectorFrontendHost::copyText(const String& text) |
166 { | 172 { |
167 Pasteboard::generalPasteboard()->writePlainText(text, Pasteboard::CannotSmar tReplace); | 173 Pasteboard::generalPasteboard()->writePlainText(text, Pasteboard::CannotSmar tReplace); |
168 } | 174 } |
169 | 175 |
170 static String escapeUnicodeNonCharacters(const String& str) | 176 static String escapeUnicodeNonCharacters(const String& str) |
171 { | 177 { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
253 { | 259 { |
254 return m_client && m_client->isUnderTest(); | 260 return m_client && m_client->isUnderTest(); |
255 } | 261 } |
256 | 262 |
257 bool InspectorFrontendHost::isHostedMode() | 263 bool InspectorFrontendHost::isHostedMode() |
258 { | 264 { |
259 return false; | 265 return false; |
260 } | 266 } |
261 | 267 |
262 } // namespace blink | 268 } // namespace blink |
OLD | NEW |