| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/api/tabs/tabs_event_router.h" | 5 #include "chrome/browser/extensions/api/tabs/tabs_event_router.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 router_->UnregisterForTabNotifications(web_contents()); | 134 router_->UnregisterForTabNotifications(web_contents()); |
| 135 } | 135 } |
| 136 | 136 |
| 137 TabsEventRouter::TabsEventRouter(Profile* profile) | 137 TabsEventRouter::TabsEventRouter(Profile* profile) |
| 138 : profile_(profile), | 138 : profile_(profile), |
| 139 favicon_scoped_observer_(this), | 139 favicon_scoped_observer_(this), |
| 140 browser_tab_strip_tracker_(this, this, this), | 140 browser_tab_strip_tracker_(this, this, this), |
| 141 tab_manager_scoped_observer_(this) { | 141 tab_manager_scoped_observer_(this) { |
| 142 DCHECK(!profile->IsOffTheRecord()); | 142 DCHECK(!profile->IsOffTheRecord()); |
| 143 | 143 |
| 144 browser_tab_strip_tracker_.Init( | 144 browser_tab_strip_tracker_.Init(); |
| 145 BrowserTabStripTracker::InitWith::ALL_BROWERS); | |
| 146 | 145 |
| 147 tab_manager_scoped_observer_.Add(g_browser_process->GetTabManager()); | 146 tab_manager_scoped_observer_.Add(g_browser_process->GetTabManager()); |
| 148 } | 147 } |
| 149 | 148 |
| 150 TabsEventRouter::~TabsEventRouter() { | 149 TabsEventRouter::~TabsEventRouter() { |
| 151 } | 150 } |
| 152 | 151 |
| 153 bool TabsEventRouter::ShouldTrackBrowser(Browser* browser) { | 152 bool TabsEventRouter::ShouldTrackBrowser(Browser* browser) { |
| 154 return profile_->IsSameProfile(browser->profile()) && | 153 return profile_->IsSameProfile(browser->profile()) && |
| 155 ExtensionTabUtil::BrowserSupportsTabs(browser); | 154 ExtensionTabUtil::BrowserSupportsTabs(browser); |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 } | 551 } |
| 553 | 552 |
| 554 void TabsEventRouter::OnAutoDiscardableStateChange(WebContents* contents, | 553 void TabsEventRouter::OnAutoDiscardableStateChange(WebContents* contents, |
| 555 bool is_auto_discardable) { | 554 bool is_auto_discardable) { |
| 556 std::set<std::string> changed_property_names; | 555 std::set<std::string> changed_property_names; |
| 557 changed_property_names.insert(tabs_constants::kAutoDiscardableKey); | 556 changed_property_names.insert(tabs_constants::kAutoDiscardableKey); |
| 558 DispatchTabUpdatedEvent(contents, std::move(changed_property_names)); | 557 DispatchTabUpdatedEvent(contents, std::move(changed_property_names)); |
| 559 } | 558 } |
| 560 | 559 |
| 561 } // namespace extensions | 560 } // namespace extensions |
| OLD | NEW |