Commit ea174708 authored by yoshiki's avatar yoshiki Committed by Commit bot

Use int32_t for duration property of toast

To match it with the API. Android and mojo API use 32bit int for this property.

BUG=none

Review-Url: https://codereview.chromium.org/2031973003
Cr-Commit-Position: refs/heads/master@{#397833}
parent 225a7433
...@@ -12,14 +12,12 @@ ...@@ -12,14 +12,12 @@
namespace ash { namespace ash {
struct ASH_EXPORT ToastData { struct ASH_EXPORT ToastData {
ToastData(const std::string& id, ToastData(const std::string& id, const std::string& text, int32_t duration_ms)
const std::string& text,
uint64_t duration_ms)
: id(id), text(text), duration_ms(duration_ms) {} : id(id), text(text), duration_ms(duration_ms) {}
std::string id; std::string id;
std::string text; std::string text;
uint64_t duration_ms; int32_t duration_ms;
}; };
} // namespace ash } // namespace ash
......
...@@ -13,7 +13,7 @@ namespace ash { ...@@ -13,7 +13,7 @@ namespace ash {
namespace { namespace {
// Minimum duration for a toast to be visible (in millisecond). // Minimum duration for a toast to be visible (in millisecond).
uint64_t kMinimumDurationMs = 200; int32_t kMinimumDurationMs = 200;
} // anonymous namespace } // anonymous namespace
...@@ -72,7 +72,7 @@ void ToastManager::ShowLatest() { ...@@ -72,7 +72,7 @@ void ToastManager::ShowLatest() {
const ToastData data = std::move(queue_.front()); const ToastData data = std::move(queue_.front());
queue_.pop_front(); queue_.pop_front();
uint64_t duration_ms = std::max(data.duration_ms, kMinimumDurationMs); int32_t duration_ms = std::max(data.duration_ms, kMinimumDurationMs);
current_toast_id_ = data.id; current_toast_id_ = data.id;
serial_++; serial_++;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
namespace ash { namespace ash {
// Long duration so the timeout doesn't occur. // Long duration so the timeout doesn't occur.
const int64_t kLongLongDuration = INT64_MAX; const int32_t kLongLongDuration = INT32_MAX;
class DummyEvent : public ui::Event { class DummyEvent : public ui::Event {
public: public:
...@@ -76,7 +76,7 @@ class ToastManagerTest : public test::AshTestBase { ...@@ -76,7 +76,7 @@ class ToastManagerTest : public test::AshTestBase {
Shelf::ForPrimaryDisplay()->SetAutoHideBehavior(behavior); Shelf::ForPrimaryDisplay()->SetAutoHideBehavior(behavior);
} }
std::string ShowToast(const std::string& text, uint64_t duration) { std::string ShowToast(const std::string& text, int32_t duration) {
std::string id = "TOAST_ID_" + base::UintToString(serial_++); std::string id = "TOAST_ID_" + base::UintToString(serial_++);
manager()->Show(ToastData(id, text, duration)); manager()->Show(ToastData(id, text, duration));
return id; return id;
......
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