• sangwoo.ko's avatar
    Introduce TabStripModelObserver::OnTabStripChanged() · 668642c3
    sangwoo.ko authored
    Previously, selection and content changes were sent as separate callbacks.
    This caused consistency errors in observers, as the two must be processed
    simultaneously.
    
    TabStripModelObserver::OnTabStripChanged() carries selection and contents
    data at the same time. And it'll be called after tab strip model finishes
    it's work. So we don't have to care about model's state that much.
    
    Thus, we can replace following with OnTabStripChanged():
      void TabInsertedAt(...);
      void TabReplacedAt(...);
      void TabMoved(...);
      void TabClosingAt(...);
      void TabDetachedAt(...);
      void TabDeactivated(...);
      void ActiveTabChanged(...);
      void TabSelectionChanged(...);
    
    Also this callback allows us to handle multiple changes in a single
    callback. e.g. multiple tab closing, insertion, etc.
    
    Change-Id: Iae824f8be536dbe699ba0108bf242114e0906ec7
    Bug: 842194
    Reviewed-on: https://chromium-review.googlesource.com/1140105
    Commit-Queue: Sang Woo Ko <sangwoo108@chromium.org>
    Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#579707}
    668642c3
tab_strip_model_observer.h 12.5 KB