OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 m_scriptsToEvaluateOnLoad.clear(); | 292 m_scriptsToEvaluateOnLoad.clear(); |
293 } | 293 } |
294 | 294 |
295 void InspectorPageAgent::reload(ErrorString*, const bool* const optionalIgnoreCa
che) | 295 void InspectorPageAgent::reload(ErrorString*, const bool* const optionalIgnoreCa
che) |
296 { | 296 { |
297 m_page->mainFrame()->loader()->reload(optionalIgnoreCache ? *optionalIgnoreC
ache : false); | 297 m_page->mainFrame()->loader()->reload(optionalIgnoreCache ? *optionalIgnoreC
ache : false); |
298 } | 298 } |
299 | 299 |
300 void InspectorPageAgent::open(ErrorString*, const String& url, const bool* const
inNewWindow) | 300 void InspectorPageAgent::open(ErrorString*, const String& url, const bool* const
inNewWindow) |
301 { | 301 { |
| 302 UserGestureIndicator indicator(DefinitelyProcessingUserGesture); |
| 303 |
302 Frame* mainFrame = m_page->mainFrame(); | 304 Frame* mainFrame = m_page->mainFrame(); |
303 Frame* frame; | 305 Frame* frame; |
304 if (inNewWindow && *inNewWindow) { | 306 if (inNewWindow && *inNewWindow) { |
305 FrameLoadRequest request(mainFrame->document()->securityOrigin(), Resour
ceRequest(), "_blank"); | 307 FrameLoadRequest request(mainFrame->document()->securityOrigin(), Resour
ceRequest(), "_blank"); |
306 | 308 |
307 bool created; | 309 bool created; |
308 WindowFeatures windowFeatures; | 310 WindowFeatures windowFeatures; |
309 frame = WebCore::createWindow(mainFrame, mainFrame, request, windowFeatu
res, created); | 311 frame = WebCore::createWindow(mainFrame, mainFrame, request, windowFeatu
res, created); |
310 if (!frame) | 312 if (!frame) |
311 return; | 313 return; |
312 | 314 |
313 frame->loader()->setOpener(mainFrame); | 315 frame->loader()->setOpener(mainFrame); |
314 frame->page()->setOpenedByDOM(); | 316 frame->page()->setOpenedByDOM(); |
315 } else | 317 } else |
316 frame = mainFrame; | 318 frame = mainFrame; |
317 | 319 |
318 UserGestureIndicator indicator(DefinitelyProcessingUserGesture); | |
319 // FIXME: Why does one use mainFrame and the other frame? | 320 // FIXME: Why does one use mainFrame and the other frame? |
320 frame->loader()->changeLocation(mainFrame->document()->securityOrigin(), fra
me->document()->completeURL(url), "", false, false); | 321 frame->loader()->changeLocation(mainFrame->document()->securityOrigin(), fra
me->document()->completeURL(url), "", false, false); |
321 } | 322 } |
322 | 323 |
323 static PassRefPtr<InspectorObject> buildObjectForCookie(const Cookie& cookie) | 324 static PassRefPtr<InspectorObject> buildObjectForCookie(const Cookie& cookie) |
324 { | 325 { |
325 RefPtr<InspectorObject> value = InspectorObject::create(); | 326 RefPtr<InspectorObject> value = InspectorObject::create(); |
326 value->setString("name", cookie.name); | 327 value->setString("name", cookie.name); |
327 value->setString("value", cookie.value); | 328 value->setString("value", cookie.value); |
328 value->setString("domain", cookie.domain); | 329 value->setString("domain", cookie.domain); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 result->setArray("childFrames", childrenArray); | 645 result->setArray("childFrames", childrenArray); |
645 } | 646 } |
646 childrenArray->pushObject(buildObjectForFrameTree(child)); | 647 childrenArray->pushObject(buildObjectForFrameTree(child)); |
647 } | 648 } |
648 return result; | 649 return result; |
649 } | 650 } |
650 | 651 |
651 } // namespace WebCore | 652 } // namespace WebCore |
652 | 653 |
653 #endif // ENABLE(INSPECTOR) | 654 #endif // ENABLE(INSPECTOR) |
OLD | NEW |