Commit a6b8adf9 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate MessageLoop::current() to MessageLoopCurrent in /ui/views

These changes were scripted as part of the effort to restrict exposure of the
raw MessageLoop*.

Note that many static methods exposed on MessageLoopCurrent are also deprecated
so it is very well possible that this is migrating to an already deprecated
method.

The goal of this pass is to reduce usage of MessageLoop::current() (and
ultimately make it impossible to obtain the MessageLoop* statically).

As such I will not edit this CL unless the script did something logically wrong.
I defer to owners to fix highlighted usage of already deprecated APIs.

Possible script screw ups / things to look out for in this review:
 - Storing MessageLoopCurrent in a MessageLoop* variable or comparing it against
   one (I will go over that in a separate pass).

Includes should have been stripped if that was the last usage of message_loop.h
in that file.

Please CQ if LGTY

This CL was uploaded by git cl split.

TBR=msw@chromium.org

Bug: 825327
Change-Id: I508ddefd5a91415253e907811a17b7d11c818a12
Reviewed-on: https://chromium-review.googlesource.com/1024712Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Commit-Queue: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553711}
parent b13c9d1e
......@@ -7,7 +7,7 @@
#include <algorithm>
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_current.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "cc/paint/paint_flags.h"
......@@ -138,7 +138,7 @@ void Slider::SetValueInternal(float value, SliderChangeReason reason) {
if (listener_)
listener_->SliderValueChanged(this, value_, old_value, reason);
if (old_value_valid && base::MessageLoop::current()) {
if (old_value_valid && base::MessageLoopCurrent::Get()) {
// Do not animate when setting the value of the slider for the first time.
// There is no message-loop when running tests. So we cannot animate then.
if (!move_animation_) {
......
......@@ -22,8 +22,8 @@ class ViewsTestHelper;
// by ViewsTestBase.
class ScopedViewsTestHelper {
public:
// Initialize with the default TestViewsDelegate, MessageLoopForUI::current()
// and the default test ContextFactory.
// Initialize with the default TestViewsDelegate,
// MessageLoopCurrentForUI::Get() and the default test ContextFactory.
ScopedViewsTestHelper();
// Initialize with the given TestViewsDelegate instance, after setting the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment