Remove unsafe int->enum casts

In each case, we're storing integers in a database and casting to the enum
when reading from the database. If the database is corrupt (or if we add an enum
value and then the user downgrades), we're at risk of crashing later on.

This should fix all occurences within offline_pages/

Bug: 944674
Change-Id: I37491a6aa132feef6e8e13f66f1734a18013acdb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1534472
Commit-Queue: Dan H <harringtond@google.com>
Reviewed-by: Min Qin <qinmin@chromium.org>
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#647952}
11 files changed