OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 WebFileChooserCompletion* completion; // MAY BE NULL to skip callback. | 454 WebFileChooserCompletion* completion; // MAY BE NULL to skip callback. |
455 }; | 455 }; |
456 | 456 |
457 namespace { | 457 namespace { |
458 | 458 |
459 class WebWidgetLockTarget : public MouseLockDispatcher::LockTarget { | 459 class WebWidgetLockTarget : public MouseLockDispatcher::LockTarget { |
460 public: | 460 public: |
461 explicit WebWidgetLockTarget(blink::WebWidget* webwidget) | 461 explicit WebWidgetLockTarget(blink::WebWidget* webwidget) |
462 : webwidget_(webwidget) {} | 462 : webwidget_(webwidget) {} |
463 | 463 |
464 virtual void OnLockMouseACK(bool succeeded) override { | 464 void OnLockMouseACK(bool succeeded) override { |
465 if (succeeded) | 465 if (succeeded) |
466 webwidget_->didAcquirePointerLock(); | 466 webwidget_->didAcquirePointerLock(); |
467 else | 467 else |
468 webwidget_->didNotAcquirePointerLock(); | 468 webwidget_->didNotAcquirePointerLock(); |
469 } | 469 } |
470 | 470 |
471 virtual void OnMouseLockLost() override { | 471 void OnMouseLockLost() override { webwidget_->didLosePointerLock(); } |
472 webwidget_->didLosePointerLock(); | |
473 } | |
474 | 472 |
475 virtual bool HandleMouseLockedInputEvent( | 473 bool HandleMouseLockedInputEvent(const blink::WebMouseEvent& event) override { |
476 const blink::WebMouseEvent &event) override { | |
477 // The WebWidget handles mouse lock in WebKit's handleInputEvent(). | 474 // The WebWidget handles mouse lock in WebKit's handleInputEvent(). |
478 return false; | 475 return false; |
479 } | 476 } |
480 | 477 |
481 private: | 478 private: |
482 blink::WebWidget* webwidget_; | 479 blink::WebWidget* webwidget_; |
483 }; | 480 }; |
484 | 481 |
485 bool TouchEnabled() { | 482 bool TouchEnabled() { |
486 // Based on the definition of chrome::kEnableTouchIcon. | 483 // Based on the definition of chrome::kEnableTouchIcon. |
(...skipping 3715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4202 std::vector<gfx::Size> sizes; | 4199 std::vector<gfx::Size> sizes; |
4203 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4200 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4204 if (!url.isEmpty()) | 4201 if (!url.isEmpty()) |
4205 urls.push_back( | 4202 urls.push_back( |
4206 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4203 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4207 } | 4204 } |
4208 SendUpdateFaviconURL(urls); | 4205 SendUpdateFaviconURL(urls); |
4209 } | 4206 } |
4210 | 4207 |
4211 } // namespace content | 4208 } // namespace content |
OLD | NEW |