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

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

Issue 14238037: Made it possible to tell whether an extension is being installed or updated. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added extra check. Created 7 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "base/run_loop.h" 5 #include "base/run_loop.h"
6 #include "base/stringprintf.h" 6 #include "base/stringprintf.h"
7 #include "chrome/browser/extensions/blacklist.h" 7 #include "chrome/browser/extensions/blacklist.h"
8 #include "chrome/browser/extensions/extension_browsertest.h" 8 #include "chrome/browser/extensions/extension_browsertest.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/extension_system.h" 10 #include "chrome/browser/extensions/extension_system.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 private: 78 private:
79 // content::NotificationObserver implementation. 79 // content::NotificationObserver implementation.
80 virtual void Observe(int type, 80 virtual void Observe(int type,
81 const content::NotificationSource& source, 81 const content::NotificationSource& source,
82 const content::NotificationDetails& details) OVERRIDE { 82 const content::NotificationDetails& details) OVERRIDE {
83 switch (type) { 83 switch (type) {
84 case chrome::NOTIFICATION_EXTENSION_INSTALLED: { 84 case chrome::NOTIFICATION_EXTENSION_INSTALLED: {
85 const Extension* extension = 85 const Extension* extension =
86 content::Details<const Extension>(details).ptr(); 86 content::Details<const InstalledExtensionInfo>(details)->extension;
87 if (extension_ids_.count(extension->id())) 87 if (extension_ids_.count(extension->id()))
88 notifications_.push_back(static_cast<chrome::NotificationType>(type)); 88 notifications_.push_back(static_cast<chrome::NotificationType>(type));
89 break; 89 break;
90 } 90 }
91 91
92 case chrome::NOTIFICATION_EXTENSION_LOADED: { 92 case chrome::NOTIFICATION_EXTENSION_LOADED: {
93 const Extension* extension = 93 const Extension* extension =
94 content::Details<const Extension>(details).ptr(); 94 content::Details<const Extension>(details).ptr();
95 if (extension_ids_.count(extension->id())) 95 if (extension_ids_.count(extension->id()))
96 notifications_.push_back(static_cast<chrome::NotificationType>(type)); 96 notifications_.push_back(static_cast<chrome::NotificationType>(type));
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 387
388 EXPECT_TRUE(IsBlacklisted(extension_a)); 388 EXPECT_TRUE(IsBlacklisted(extension_a));
389 EXPECT_TRUE(IsSafe(extension_b)); 389 EXPECT_TRUE(IsSafe(extension_b));
390 EXPECT_TRUE(IsBlacklisted(extension_c)); 390 EXPECT_TRUE(IsBlacklisted(extension_c));
391 EXPECT_TRUE(notifications.CheckNotifications( 391 EXPECT_TRUE(notifications.CheckNotifications(
392 chrome::NOTIFICATION_EXTENSION_LOADED, 392 chrome::NOTIFICATION_EXTENSION_LOADED,
393 chrome::NOTIFICATION_EXTENSION_UNLOADED)); 393 chrome::NOTIFICATION_EXTENSION_UNLOADED));
394 } 394 }
395 395
396 } // namespace extensions 396 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/event_router.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698