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

Side by Side Diff: components/test_runner/event_sender.cc

Issue 1840823002: Extract WebViewClient implementation out of WebTestProxyBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@separate-pixel-dump-code
Patch Set: Expanding a comment + an IWYU fix. Created 4 years, 8 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
« no previous file with comments | « components/test_runner/BUILD.gn ('k') | components/test_runner/test_runner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/test_runner/event_sender.h" 5 #include "components/test_runner/event_sender.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 1636
1637 void EventSender::TextZoomOut() { 1637 void EventSender::TextZoomOut() {
1638 view_->setTextZoomFactor(view_->textZoomFactor() / 1.2f); 1638 view_->setTextZoomFactor(view_->textZoomFactor() / 1.2f);
1639 } 1639 }
1640 1640
1641 void EventSender::ZoomPageIn() { 1641 void EventSender::ZoomPageIn() {
1642 const std::vector<WebTestProxyBase*>& window_list = 1642 const std::vector<WebTestProxyBase*>& window_list =
1643 interfaces_->GetWindowList(); 1643 interfaces_->GetWindowList();
1644 1644
1645 for (size_t i = 0; i < window_list.size(); ++i) { 1645 for (size_t i = 0; i < window_list.size(); ++i) {
1646 window_list.at(i)->GetWebView()->setZoomLevel( 1646 window_list.at(i)->web_view()->setZoomLevel(
1647 window_list.at(i)->GetWebView()->zoomLevel() + 1); 1647 window_list.at(i)->web_view()->zoomLevel() + 1);
1648 } 1648 }
1649 } 1649 }
1650 1650
1651 void EventSender::ZoomPageOut() { 1651 void EventSender::ZoomPageOut() {
1652 const std::vector<WebTestProxyBase*>& window_list = 1652 const std::vector<WebTestProxyBase*>& window_list =
1653 interfaces_->GetWindowList(); 1653 interfaces_->GetWindowList();
1654 1654
1655 for (size_t i = 0; i < window_list.size(); ++i) { 1655 for (size_t i = 0; i < window_list.size(); ++i) {
1656 window_list.at(i)->GetWebView()->setZoomLevel( 1656 window_list.at(i)->web_view()->setZoomLevel(
1657 window_list.at(i)->GetWebView()->zoomLevel() - 1); 1657 window_list.at(i)->web_view()->zoomLevel() - 1);
1658 } 1658 }
1659 } 1659 }
1660 1660
1661 void EventSender::SetPageZoomFactor(double zoom_factor) { 1661 void EventSender::SetPageZoomFactor(double zoom_factor) {
1662 const std::vector<WebTestProxyBase*>& window_list = 1662 const std::vector<WebTestProxyBase*>& window_list =
1663 interfaces_->GetWindowList(); 1663 interfaces_->GetWindowList();
1664 1664
1665 for (size_t i = 0; i < window_list.size(); ++i) { 1665 for (size_t i = 0; i < window_list.size(); ++i) {
1666 window_list.at(i)->GetWebView()->setZoomLevel( 1666 window_list.at(i)->web_view()->setZoomLevel(std::log(zoom_factor) /
1667 std::log(zoom_factor) / std::log(1.2)); 1667 std::log(1.2));
1668 } 1668 }
1669 } 1669 }
1670 1670
1671 void EventSender::ClearTouchPoints() { 1671 void EventSender::ClearTouchPoints() {
1672 touch_points_.clear(); 1672 touch_points_.clear();
1673 } 1673 }
1674 1674
1675 void EventSender::ThrowTouchPointError() { 1675 void EventSender::ThrowTouchPointError() {
1676 v8::Isolate* isolate = blink::mainThreadIsolate(); 1676 v8::Isolate* isolate = blink::mainThreadIsolate();
1677 isolate->ThrowException(v8::Exception::TypeError( 1677 isolate->ThrowException(v8::Exception::TypeError(
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
2655 &end_event); 2655 &end_event);
2656 end_event.data.scrollEnd.deltaUnits = 2656 end_event.data.scrollEnd.deltaUnits =
2657 begin_event.data.scrollBegin.deltaHintUnits; 2657 begin_event.data.scrollBegin.deltaHintUnits;
2658 2658
2659 if (force_layout_on_events_) 2659 if (force_layout_on_events_)
2660 view_->updateAllLifecyclePhases(); 2660 view_->updateAllLifecyclePhases();
2661 HandleInputEventOnViewOrPopup(end_event); 2661 HandleInputEventOnViewOrPopup(end_event);
2662 } 2662 }
2663 2663
2664 } // namespace test_runner 2664 } // namespace test_runner
OLDNEW
« no previous file with comments | « components/test_runner/BUILD.gn ('k') | components/test_runner/test_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698