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

Side by Side Diff: extensions/browser/declarative_user_script_manager.cc

Issue 2839373003: struct UnloadedExtensionInfo -> enum UnloadedExtensionInfoReason (Closed)
Patch Set: Rebase 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
« no previous file with comments | « extensions/browser/declarative_user_script_manager.h ('k') | extensions/browser/event_router.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/declarative_user_script_manager.h" 5 #include "extensions/browser/declarative_user_script_manager.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "content/public/browser/browser_context.h" 8 #include "content/public/browser/browser_context.h"
9 #include "extensions/browser/declarative_user_script_manager_factory.h" 9 #include "extensions/browser/declarative_user_script_manager_factory.h"
10 #include "extensions/browser/declarative_user_script_master.h" 10 #include "extensions/browser/declarative_user_script_master.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return declarative_user_script_masters_ 47 return declarative_user_script_masters_
48 .insert( 48 .insert(
49 std::make_pair(host_id, base::MakeUnique<DeclarativeUserScriptMaster>( 49 std::make_pair(host_id, base::MakeUnique<DeclarativeUserScriptMaster>(
50 browser_context_, host_id))) 50 browser_context_, host_id)))
51 .first->second.get(); 51 .first->second.get();
52 } 52 }
53 53
54 void DeclarativeUserScriptManager::OnExtensionUnloaded( 54 void DeclarativeUserScriptManager::OnExtensionUnloaded(
55 content::BrowserContext* browser_context, 55 content::BrowserContext* browser_context,
56 const Extension* extension, 56 const Extension* extension,
57 UnloadedExtensionInfo::Reason reason) { 57 UnloadedExtensionReason reason) {
58 for (const auto& val : declarative_user_script_masters_) { 58 for (const auto& val : declarative_user_script_masters_) {
59 DeclarativeUserScriptMaster* master = val.second.get(); 59 DeclarativeUserScriptMaster* master = val.second.get();
60 if (master->host_id().id() == extension->id()) 60 if (master->host_id().id() == extension->id())
61 master->ClearScripts(); 61 master->ClearScripts();
62 } 62 }
63 } 63 }
64 64
65 } // namespace extensions 65 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/declarative_user_script_manager.h ('k') | extensions/browser/event_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698