| 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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 TabStripModel* tab_strip = nullptr; | 562 TabStripModel* tab_strip = nullptr; |
| 563 int tab_index = -1; | 563 int tab_index = -1; |
| 564 | 564 |
| 565 if (ExtensionTabUtil::GetTabStripModel(contents, &tab_strip, &tab_index)) { | 565 if (ExtensionTabUtil::GetTabStripModel(contents, &tab_strip, &tab_index)) { |
| 566 std::set<std::string> changed_property_names; | 566 std::set<std::string> changed_property_names; |
| 567 changed_property_names.insert(tabs_constants::kDiscardedKey); | 567 changed_property_names.insert(tabs_constants::kDiscardedKey); |
| 568 DispatchTabUpdatedEvent(contents, std::move(changed_property_names)); | 568 DispatchTabUpdatedEvent(contents, std::move(changed_property_names)); |
| 569 } | 569 } |
| 570 } | 570 } |
| 571 | 571 |
| 572 void TabsEventRouter::OnAutoDiscardableStateChange(WebContents* contents, |
| 573 bool is_auto_discardable) { |
| 574 TabStripModel* tab_strip = nullptr; |
| 575 int tab_index = -1; |
| 576 |
| 577 if (ExtensionTabUtil::GetTabStripModel(contents, &tab_strip, &tab_index)) { |
| 578 std::set<std::string> changed_property_names; |
| 579 changed_property_names.insert(tabs_constants::kAutoDiscardableKey); |
| 580 DispatchTabUpdatedEvent(contents, std::move(changed_property_names)); |
| 581 } |
| 582 } |
| 583 |
| 572 } // namespace extensions | 584 } // namespace extensions |
| OLD | NEW |