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

Unified Diff: chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc

Issue 660173002: Type conversion fixes, ui/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/base/accelerators/accelerator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc
diff --git a/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc b/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc
index 87ccc9f0adacaa944b779120a7632d8b0829fb06..cc84e8f8a338ad77b128fd691db99b26e5e65760 100644
--- a/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc
+++ b/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc
@@ -64,15 +64,16 @@ class TabScrubberTest : public InProcessBrowserTest,
return BrowserView::GetBrowserViewForNativeWindow(window)->tabstrip();
}
- int GetStartX(Browser* browser,
- int index,
- TabScrubber::Direction direction) {
- return TabScrubber::GetStartPoint(
- GetTabStrip(browser), index, direction).x();
+ float GetStartX(Browser* browser,
+ int index,
+ TabScrubber::Direction direction) {
+ return static_cast<float>(TabScrubber::GetStartPoint(
+ GetTabStrip(browser), index, direction).x());
}
- int GetTabCenter(Browser* browser, int index) {
- return GetTabStrip(browser)->tab_at(index)->bounds().CenterPoint().x();
+ float GetTabCenter(Browser* browser, int index) {
+ return static_cast<float>(
+ GetTabStrip(browser)->tab_at(index)->bounds().CenterPoint().x());
}
// Sends one scroll event synchronously without initial or final
@@ -84,10 +85,10 @@ class TabScrubberTest : public InProcessBrowserTest,
int active_index = browser->tab_strip_model()->active_index();
TabScrubber::Direction direction = index < active_index ?
TabScrubber::LEFT : TabScrubber::RIGHT;
- int offset = GetTabCenter(browser, index) -
+ float offset = GetTabCenter(browser, index) -
GetStartX(browser, active_index, direction);
ui::ScrollEvent scroll_event(ui::ET_SCROLL,
- gfx::Point(0, 0),
+ gfx::PointF(0, 0),
ui::EventTimeForNow(),
0,
offset, 0,
@@ -124,15 +125,15 @@ class TabScrubberTest : public InProcessBrowserTest,
}
if (scrub_type == SKIP_TABS)
increment *= 2;
- int last = GetStartX(browser, active_index, direction);
- std::vector<gfx::Point> offsets;
+ float last = GetStartX(browser, active_index, direction);
+ std::vector<gfx::PointF> offsets;
for (int i = active_index + increment; i != (index + increment);
- i += increment) {
- int tab_center = GetTabCenter(browser, i);
- offsets.push_back(gfx::Point(tab_center - last, 0));
+ i += increment) {
+ float tab_center = GetTabCenter(browser, i);
+ offsets.push_back(gfx::PointF(tab_center - last, 0));
last = GetStartX(browser, i, direction);
if (scrub_type == REPEAT_TABS) {
- offsets.push_back(gfx::Point(increment, 0));
+ offsets.push_back(gfx::PointF(static_cast<float>(increment), 0));
last += increment;
}
}
@@ -147,7 +148,7 @@ class TabScrubberTest : public InProcessBrowserTest,
// if it's different from the currently active tab.
// If the active tab is expected to stay the same, send events
// synchronously (as we don't have anything to wait for).
- void SendScrubSequence(Browser* browser, int x_offset, int index) {
+ void SendScrubSequence(Browser* browser, float x_offset, int index) {
aura::Window* window = browser->window()->GetNativeWindow();
aura::Window* root = window->GetRootWindow();
ui::test::EventGenerator event_generator(root, window);
« no previous file with comments | « no previous file | ui/base/accelerators/accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698