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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 2782893002: WebMouseEvent coordinates are now fractional & private (Closed)
Patch Set: Rebased, fixed a comment in web_input_event_builders_mac.mm Created 3 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
OLDNEW
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 776
777 // Sends a mouse click at the given coordinates to the current renderer. 777 // Sends a mouse click at the given coordinates to the current renderer.
778 void PerformClick(int x, int y) { 778 void PerformClick(int x, int y) {
779 content::WebContents* contents = 779 content::WebContents* contents =
780 browser()->tab_strip_model()->GetActiveWebContents(); 780 browser()->tab_strip_model()->GetActiveWebContents();
781 blink::WebMouseEvent click_event(blink::WebInputEvent::MouseDown, 781 blink::WebMouseEvent click_event(blink::WebInputEvent::MouseDown,
782 blink::WebInputEvent::NoModifiers, 782 blink::WebInputEvent::NoModifiers,
783 blink::WebInputEvent::TimeStampForTesting); 783 blink::WebInputEvent::TimeStampForTesting);
784 click_event.button = blink::WebMouseEvent::Button::Left; 784 click_event.button = blink::WebMouseEvent::Button::Left;
785 click_event.clickCount = 1; 785 click_event.clickCount = 1;
786 click_event.x = x; 786 click_event.setPositionInWidget(x, y);
787 click_event.y = y;
788 contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(click_event); 787 contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(click_event);
789 click_event.setType(blink::WebInputEvent::MouseUp); 788 click_event.setType(blink::WebInputEvent::MouseUp);
790 contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(click_event); 789 contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(click_event);
791 } 790 }
792 791
793 void SetPolicy(PolicyMap* policies, 792 void SetPolicy(PolicyMap* policies,
794 const char* key, 793 const char* key,
795 std::unique_ptr<base::Value> value) { 794 std::unique_ptr<base::Value> value) {
796 if (value) { 795 if (value) {
797 policies->Set(key, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, 796 policies->Set(key, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
(...skipping 3672 matching lines...) Expand 10 before | Expand all | Expand 10 after
4470 4469
4471 SetEmptyPolicy(); 4470 SetEmptyPolicy();
4472 // Policy not set. 4471 // Policy not set.
4473 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4472 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4474 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4473 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4475 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4474 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4476 } 4475 }
4477 #endif // defined(OS_CHROMEOS) 4476 #endif // defined(OS_CHROMEOS)
4478 4477
4479 } // namespace policy 4478 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698