| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ios/chrome/browser/tab_parenting_global_observer.h" | 5 #include "ios/chrome/browser/tab_parenting_global_observer.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 | 8 |
| 9 TabParentingGlobalObserver* TabParentingGlobalObserver::GetInstance() { | 9 TabParentingGlobalObserver* TabParentingGlobalObserver::GetInstance() { |
| 10 return base::Singleton<TabParentingGlobalObserver>::get(); | 10 return base::Singleton<TabParentingGlobalObserver>::get(); |
| 11 } | 11 } |
| 12 | 12 |
| 13 scoped_ptr<base::CallbackList<void(web::WebState*)>::Subscription> | 13 std::unique_ptr<base::CallbackList<void(web::WebState*)>::Subscription> |
| 14 TabParentingGlobalObserver::RegisterCallback(const OnTabParentedCallback& cb) { | 14 TabParentingGlobalObserver::RegisterCallback(const OnTabParentedCallback& cb) { |
| 15 return on_tab_parented_callback_list_.Add(cb); | 15 return on_tab_parented_callback_list_.Add(cb); |
| 16 } | 16 } |
| 17 | 17 |
| 18 void TabParentingGlobalObserver::OnTabParented(web::WebState* web_state) { | 18 void TabParentingGlobalObserver::OnTabParented(web::WebState* web_state) { |
| 19 on_tab_parented_callback_list_.Notify(web_state); | 19 on_tab_parented_callback_list_.Notify(web_state); |
| 20 } | 20 } |
| 21 | 21 |
| 22 TabParentingGlobalObserver::TabParentingGlobalObserver() {} | 22 TabParentingGlobalObserver::TabParentingGlobalObserver() {} |
| 23 | 23 |
| 24 TabParentingGlobalObserver::~TabParentingGlobalObserver() {} | 24 TabParentingGlobalObserver::~TabParentingGlobalObserver() {} |
| OLD | NEW |