• Kyle Horimoto's avatar
    [CrOS PhoneHub] Create PhoneModel and MutablePhoneModel · b6136a85
    Kyle Horimoto authored
    PhoneModel stores an in-memory model of the phone during a Phone Hub
    session. Currently, it only holds a PhoneStatusModel, but future CLs
    will add support for other parts of the model (e.g., notifications,
    Chrome tabs, and quick action button status).
    
    PhoneModel also provides an observer interface for clients to use to be
    notified when the model changes. This CL also creates the
    MutablePhoneModel class, which provides setters which can cause the
    model's data to change.
    
    PhoneHubManager instantiates a MutablePhoneModel when it is created and
    exposes it publicly via a PhoneModel*, which ensures that clients of the
    model cannot edit its contents.
    
    Bug: 1106937
    Change-Id: I011c4f62916b158b291eb4abb0f38ab91fef7ac5
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2365225
    Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
    Reviewed-by: default avatarRegan Hsu <hsuregan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#799975}
    b6136a85
mutable_phone_model.cc 669 Bytes