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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 | 157 |
158 void TabsEventRouter::RegisterForTabNotifications(WebContents* contents) { | 158 void TabsEventRouter::RegisterForTabNotifications(WebContents* contents) { |
159 favicon_scoped_observer_.Add( | 159 favicon_scoped_observer_.Add( |
160 favicon::ContentFaviconDriver::FromWebContents(contents)); | 160 favicon::ContentFaviconDriver::FromWebContents(contents)); |
161 | 161 |
162 ZoomController::FromWebContents(contents)->AddObserver(this); | 162 ZoomController::FromWebContents(contents)->AddObserver(this); |
163 | 163 |
164 int tab_id = ExtensionTabUtil::GetTabId(contents); | 164 int tab_id = ExtensionTabUtil::GetTabId(contents); |
165 DCHECK(tab_entries_.find(tab_id) == tab_entries_.end()); | 165 DCHECK(tab_entries_.find(tab_id) == tab_entries_.end()); |
166 tab_entries_[tab_id] = base::WrapUnique(new TabEntry(this, contents)); | 166 tab_entries_[tab_id] = base::MakeUnique<TabEntry>(this, contents); |
167 } | 167 } |
168 | 168 |
169 void TabsEventRouter::UnregisterForTabNotifications(WebContents* contents) { | 169 void TabsEventRouter::UnregisterForTabNotifications(WebContents* contents) { |
170 favicon_scoped_observer_.Remove( | 170 favicon_scoped_observer_.Remove( |
171 favicon::ContentFaviconDriver::FromWebContents(contents)); | 171 favicon::ContentFaviconDriver::FromWebContents(contents)); |
172 | 172 |
173 ZoomController::FromWebContents(contents)->RemoveObserver(this); | 173 ZoomController::FromWebContents(contents)->RemoveObserver(this); |
174 | 174 |
175 int tab_id = ExtensionTabUtil::GetTabId(contents); | 175 int tab_id = ExtensionTabUtil::GetTabId(contents); |
176 int removed_count = tab_entries_.erase(tab_id); | 176 int removed_count = tab_entries_.erase(tab_id); |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 int tab_index = -1; | 575 int tab_index = -1; |
576 | 576 |
577 if (ExtensionTabUtil::GetTabStripModel(contents, &tab_strip, &tab_index)) { | 577 if (ExtensionTabUtil::GetTabStripModel(contents, &tab_strip, &tab_index)) { |
578 std::set<std::string> changed_property_names; | 578 std::set<std::string> changed_property_names; |
579 changed_property_names.insert(tabs_constants::kAutoDiscardableKey); | 579 changed_property_names.insert(tabs_constants::kAutoDiscardableKey); |
580 DispatchTabUpdatedEvent(contents, std::move(changed_property_names)); | 580 DispatchTabUpdatedEvent(contents, std::move(changed_property_names)); |
581 } | 581 } |
582 } | 582 } |
583 | 583 |
584 } // namespace extensions | 584 } // namespace extensions |
OLD | NEW |