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

Side by Side Diff: chrome/browser/extensions/tab_helper.cc

Issue 2422963002: Remove FOR_EACH_OBSERVER macro usage in chrome/browser/extensions (Closed)
Patch Set: extensions Created 4 years, 2 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/tab_helper.h" 5 #include "chrome/browser/extensions/tab_helper.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 // WebContentsObserver::Send() defaults to using the main RenderView, which 517 // WebContentsObserver::Send() defaults to using the main RenderView, which
518 // might be in a different process if the request came from a frame. 518 // might be in a different process if the request came from a frame.
519 host->Send(new ExtensionMsg_GetAppInstallStateResponse(return_route_id, state, 519 host->Send(new ExtensionMsg_GetAppInstallStateResponse(return_route_id, state,
520 callback_id)); 520 callback_id));
521 } 521 }
522 522
523 void TabHelper::OnContentScriptsExecuting( 523 void TabHelper::OnContentScriptsExecuting(
524 content::RenderFrameHost* host, 524 content::RenderFrameHost* host,
525 const ScriptExecutionObserver::ExecutingScriptsMap& executing_scripts_map, 525 const ScriptExecutionObserver::ExecutingScriptsMap& executing_scripts_map,
526 const GURL& on_url) { 526 const GURL& on_url) {
527 FOR_EACH_OBSERVER( 527 for (auto& observer : script_execution_observers_)
528 ScriptExecutionObserver, 528 observer.OnScriptsExecuted(web_contents(), executing_scripts_map, on_url);
529 script_execution_observers_,
530 OnScriptsExecuted(web_contents(), executing_scripts_map, on_url));
531 } 529 }
532 530
533 const Extension* TabHelper::GetExtension(const ExtensionId& extension_app_id) { 531 const Extension* TabHelper::GetExtension(const ExtensionId& extension_app_id) {
534 if (extension_app_id.empty()) 532 if (extension_app_id.empty())
535 return NULL; 533 return NULL;
536 534
537 content::BrowserContext* context = web_contents()->GetBrowserContext(); 535 content::BrowserContext* context = web_contents()->GetBrowserContext();
538 return ExtensionRegistry::Get(context)->enabled_extensions().GetByID( 536 return ExtensionRegistry::Get(context)->enabled_extensions().GetByID(
539 extension_app_id); 537 extension_app_id);
540 } 538 }
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 } 671 }
674 } 672 }
675 673
676 void TabHelper::SetTabId(content::RenderFrameHost* render_frame_host) { 674 void TabHelper::SetTabId(content::RenderFrameHost* render_frame_host) {
677 render_frame_host->Send( 675 render_frame_host->Send(
678 new ExtensionMsg_SetTabId(render_frame_host->GetRoutingID(), 676 new ExtensionMsg_SetTabId(render_frame_host->GetRoutingID(),
679 SessionTabHelper::IdForTab(web_contents()))); 677 SessionTabHelper::IdForTab(web_contents())));
680 } 678 }
681 679
682 } // namespace extensions 680 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/install_tracker.cc ('k') | chrome/browser/extensions/window_controller_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698