summaryrefslogtreecommitdiffstats
path: root/ios/chrome/browser/tab_parenting_global_observer.cc
blob: 1ed07d12f793a7e1d0db0650238c3ed2a308ac1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ios/chrome/browser/tab_parenting_global_observer.h"

#include "base/memory/singleton.h"

TabParentingGlobalObserver* TabParentingGlobalObserver::GetInstance() {
  return base::Singleton<TabParentingGlobalObserver>::get();
}

scoped_ptr<base::CallbackList<void(web::WebState*)>::Subscription>
TabParentingGlobalObserver::RegisterCallback(const OnTabParentedCallback& cb) {
  return on_tab_parented_callback_list_.Add(cb);
}

void TabParentingGlobalObserver::OnTabParented(web::WebState* web_state) {
  on_tab_parented_callback_list_.Notify(web_state);
}

TabParentingGlobalObserver::TabParentingGlobalObserver() {}

TabParentingGlobalObserver::~TabParentingGlobalObserver() {}