| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. 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 | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 m_webFrame->didFinish(); | 467 m_webFrame->didFinish(); |
| 468 } | 468 } |
| 469 | 469 |
| 470 void FrameLoaderClientImpl::dispatchDidChangeThemeColor() { | 470 void FrameLoaderClientImpl::dispatchDidChangeThemeColor() { |
| 471 if (m_webFrame->client()) | 471 if (m_webFrame->client()) |
| 472 m_webFrame->client()->didChangeThemeColor(); | 472 m_webFrame->client()->didChangeThemeColor(); |
| 473 } | 473 } |
| 474 | 474 |
| 475 static bool allowCreatingBackgroundTabs() { | 475 static bool allowCreatingBackgroundTabs() { |
| 476 const WebInputEvent* inputEvent = WebViewImpl::currentInputEvent(); | 476 const WebInputEvent* inputEvent = WebViewImpl::currentInputEvent(); |
| 477 if (!inputEvent || (inputEvent->type != WebInputEvent::MouseUp && | 477 if (!inputEvent || (inputEvent->type() != WebInputEvent::MouseUp && |
| 478 (inputEvent->type != WebInputEvent::RawKeyDown && | 478 (inputEvent->type() != WebInputEvent::RawKeyDown && |
| 479 inputEvent->type != WebInputEvent::KeyDown) && | 479 inputEvent->type() != WebInputEvent::KeyDown) && |
| 480 inputEvent->type != WebInputEvent::GestureTap)) | 480 inputEvent->type() != WebInputEvent::GestureTap)) |
| 481 return false; | 481 return false; |
| 482 | 482 |
| 483 unsigned short buttonNumber; | 483 unsigned short buttonNumber; |
| 484 if (WebInputEvent::isMouseEventType(inputEvent->type)) { | 484 if (WebInputEvent::isMouseEventType(inputEvent->type())) { |
| 485 const WebMouseEvent* mouseEvent = | 485 const WebMouseEvent* mouseEvent = |
| 486 static_cast<const WebMouseEvent*>(inputEvent); | 486 static_cast<const WebMouseEvent*>(inputEvent); |
| 487 | 487 |
| 488 switch (mouseEvent->button) { | 488 switch (mouseEvent->button) { |
| 489 case WebMouseEvent::Button::Left: | 489 case WebMouseEvent::Button::Left: |
| 490 buttonNumber = 0; | 490 buttonNumber = 0; |
| 491 break; | 491 break; |
| 492 case WebMouseEvent::Button::Middle: | 492 case WebMouseEvent::Button::Middle: |
| 493 buttonNumber = 1; | 493 buttonNumber = 1; |
| 494 break; | 494 break; |
| 495 case WebMouseEvent::Button::Right: | 495 case WebMouseEvent::Button::Right: |
| 496 buttonNumber = 2; | 496 buttonNumber = 2; |
| 497 break; | 497 break; |
| 498 default: | 498 default: |
| 499 return false; | 499 return false; |
| 500 } | 500 } |
| 501 } else { | 501 } else { |
| 502 // The click is simulated when triggering the keypress event. | 502 // The click is simulated when triggering the keypress event. |
| 503 buttonNumber = 0; | 503 buttonNumber = 0; |
| 504 } | 504 } |
| 505 bool ctrl = inputEvent->modifiers & WebMouseEvent::ControlKey; | 505 bool ctrl = inputEvent->modifiers() & WebMouseEvent::ControlKey; |
| 506 bool shift = inputEvent->modifiers & WebMouseEvent::ShiftKey; | 506 bool shift = inputEvent->modifiers() & WebMouseEvent::ShiftKey; |
| 507 bool alt = inputEvent->modifiers & WebMouseEvent::AltKey; | 507 bool alt = inputEvent->modifiers() & WebMouseEvent::AltKey; |
| 508 bool meta = inputEvent->modifiers & WebMouseEvent::MetaKey; | 508 bool meta = inputEvent->modifiers() & WebMouseEvent::MetaKey; |
| 509 | 509 |
| 510 NavigationPolicy userPolicy; | 510 NavigationPolicy userPolicy; |
| 511 if (!navigationPolicyFromMouseEvent(buttonNumber, ctrl, shift, alt, meta, | 511 if (!navigationPolicyFromMouseEvent(buttonNumber, ctrl, shift, alt, meta, |
| 512 &userPolicy)) | 512 &userPolicy)) |
| 513 return false; | 513 return false; |
| 514 return userPolicy == NavigationPolicyNewBackgroundTab; | 514 return userPolicy == NavigationPolicyNewBackgroundTab; |
| 515 } | 515 } |
| 516 | 516 |
| 517 NavigationPolicy FrameLoaderClientImpl::decidePolicyForNavigation( | 517 NavigationPolicy FrameLoaderClientImpl::decidePolicyForNavigation( |
| 518 const ResourceRequest& request, | 518 const ResourceRequest& request, |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 WebDevToolsAgentImpl* FrameLoaderClientImpl::devToolsAgent() { | 996 WebDevToolsAgentImpl* FrameLoaderClientImpl::devToolsAgent() { |
| 997 return WebLocalFrameImpl::fromFrame(m_webFrame->frame()->localFrameRoot()) | 997 return WebLocalFrameImpl::fromFrame(m_webFrame->frame()->localFrameRoot()) |
| 998 ->devToolsAgentImpl(); | 998 ->devToolsAgentImpl(); |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 KURL FrameLoaderClientImpl::overrideFlashEmbedWithHTML(const KURL& url) { | 1001 KURL FrameLoaderClientImpl::overrideFlashEmbedWithHTML(const KURL& url) { |
| 1002 return m_webFrame->client()->overrideFlashEmbedWithHTML(WebURL(url)); | 1002 return m_webFrame->client()->overrideFlashEmbedWithHTML(WebURL(url)); |
| 1003 } | 1003 } |
| 1004 | 1004 |
| 1005 } // namespace blink | 1005 } // namespace blink |
| OLD | NEW |