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

Side by Side Diff: chrome/browser/extensions/api/extension_action/extension_action_api.cc

Issue 2858643002: PS - Filtering activeTab URL (Closed)
Patch Set: Created 3 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extension_action/extension_action_api.h" 5 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 event_name = "pageAction.onClicked"; 218 event_name = "pageAction.onClicked";
219 break; 219 break;
220 case ActionInfo::TYPE_SYSTEM_INDICATOR: 220 case ActionInfo::TYPE_SYSTEM_INDICATOR:
221 // The System Indicator handles its own clicks. 221 // The System Indicator handles its own clicks.
222 NOTREACHED(); 222 NOTREACHED();
223 break; 223 break;
224 } 224 }
225 225
226 if (event_name) { 226 if (event_name) {
227 std::unique_ptr<base::ListValue> args(new base::ListValue()); 227 std::unique_ptr<base::ListValue> args(new base::ListValue());
228 args->Append(ExtensionTabUtil::CreateTabObject(web_contents)->ToValue()); 228 std::unique_ptr<api::tabs::Tab> tab =
229 ExtensionTabUtil::CreateTabObject(web_contents);
230 ExtensionTabUtil::PlatformSpecificFiltering(extension_action.extension_id(),
Ivan Šandrk 2017/05/03 13:00:50 Should I test this part maybe?
Devlin 2017/05/03 15:14:15 Actually, I think that what we should be doing is
Ivan Šandrk 2017/05/03 17:52:46 Right, thanks for the suggestion. Done.
231 tab.get());
232 args->Append(tab->ToValue());
229 233
230 DispatchEventToExtension(web_contents->GetBrowserContext(), 234 DispatchEventToExtension(web_contents->GetBrowserContext(),
231 extension_action.extension_id(), histogram_value, 235 extension_action.extension_id(), histogram_value,
232 event_name, std::move(args)); 236 event_name, std::move(args));
233 } 237 }
234 } 238 }
235 239
236 void ExtensionActionAPI::ClearAllValuesForTab( 240 void ExtensionActionAPI::ClearAllValuesForTab(
237 content::WebContents* web_contents) { 241 content::WebContents* web_contents) {
238 DCHECK(web_contents); 242 DCHECK(web_contents);
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 if (host->extension_host_type() != VIEW_TYPE_EXTENSION_POPUP || 617 if (host->extension_host_type() != VIEW_TYPE_EXTENSION_POPUP ||
614 host->extension()->id() != extension_->id()) 618 host->extension()->id() != extension_->id())
615 return; 619 return;
616 620
617 SendResponse(true); 621 SendResponse(true);
618 response_sent_ = true; 622 response_sent_ = true;
619 registrar_.RemoveAll(); 623 registrar_.RemoveAll();
620 } 624 }
621 625
622 } // namespace extensions 626 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698