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

Unified Diff: chrome/browser/extensions/api/tabs/windows_event_router.cc

Issue 2937623002: [Extensions] Simplify EventFilteringInfo (Closed)
Patch Set: karan's Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/tabs/windows_event_router.cc
diff --git a/chrome/browser/extensions/api/tabs/windows_event_router.cc b/chrome/browser/extensions/api/tabs/windows_event_router.cc
index 98a9cb61b7a1b15ec103babffded7023d10560d7..e24c1c698c38fc3f4f320115282f55e97397bc63 100644
--- a/chrome/browser/extensions/api/tabs/windows_event_router.cc
+++ b/chrome/browser/extensions/api/tabs/windows_event_router.cc
@@ -64,11 +64,12 @@ bool WillDispatchWindowEvent(WindowController* window_controller,
event->filter_info = EventFilteringInfo();
// Only set the window type if the listener has set a filter.
// Otherwise we set the window visibility relative to the extension.
- if (has_filter)
- event->filter_info.SetWindowType(window_controller->GetWindowTypeText());
- else
- event->filter_info.SetWindowExposedByDefault(
- window_controller->IsVisibleToExtension(extension));
+ if (has_filter) {
+ event->filter_info.window_type = window_controller->GetWindowTypeText();
+ } else {
+ event->filter_info.window_exposed_by_default =
+ window_controller->IsVisibleToExtension(extension);
+ }
return true;
}
@@ -96,12 +97,13 @@ bool WillDispatchWindowFocusedEvent(
// otherwise set the visibility to true (if the window is not
// supposed to be visible by the extension, we will clear out the
// window id later).
- if (has_filter)
- event->filter_info.SetWindowType(
+ if (has_filter) {
+ event->filter_info.window_type =
window_controller ? window_controller->GetWindowTypeText()
- : keys::kWindowTypeValueNormal);
- else
- event->filter_info.SetWindowExposedByDefault(true);
+ : keys::kWindowTypeValueNormal;
+ } else {
+ event->filter_info.window_exposed_by_default = true;
+ }
// When switching between windows in the default and incognito profiles,
// dispatch WINDOW_ID_NONE to extensions whose profile lost focus that

Powered by Google App Engine
This is Rietveld 408576698