Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Side by Side Diff: chrome/browser/extensions/api/tabs/tabs_event_router.cc

Issue 2205523002: AutoDiscardable property support on Chrome Extensions Tabs API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed nits Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_event_router.h ('k') | chrome/browser/extensions/api/tabs/tabs_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698