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

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

Issue 398083002: Add "UninstallReason" parameter to ExtensionRegistryObserver::OnExtensionUninstalled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix header file. Created 6 years, 5 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/extension_browsertest.h" 5 #include "chrome/browser/extensions/extension_browsertest.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 25 matching lines...) Expand all
36 #include "chrome/test/base/ui_test_utils.h" 36 #include "chrome/test/base/ui_test_utils.h"
37 #include "content/public/browser/navigation_controller.h" 37 #include "content/public/browser/navigation_controller.h"
38 #include "content/public/browser/navigation_entry.h" 38 #include "content/public/browser/navigation_entry.h"
39 #include "content/public/browser/notification_registrar.h" 39 #include "content/public/browser/notification_registrar.h"
40 #include "content/public/browser/notification_service.h" 40 #include "content/public/browser/notification_service.h"
41 #include "content/public/browser/render_view_host.h" 41 #include "content/public/browser/render_view_host.h"
42 #include "content/public/test/browser_test_utils.h" 42 #include "content/public/test/browser_test_utils.h"
43 #include "extensions/browser/extension_host.h" 43 #include "extensions/browser/extension_host.h"
44 #include "extensions/browser/extension_prefs.h" 44 #include "extensions/browser/extension_prefs.h"
45 #include "extensions/browser/extension_system.h" 45 #include "extensions/browser/extension_system.h"
46 #include "extensions/browser/uninstall_reason.h"
46 #include "extensions/common/constants.h" 47 #include "extensions/common/constants.h"
47 #include "extensions/common/extension_set.h" 48 #include "extensions/common/extension_set.h"
48 #include "sync/api/string_ordinal.h" 49 #include "sync/api/string_ordinal.h"
49 50
50 #if defined(OS_CHROMEOS) 51 #if defined(OS_CHROMEOS)
51 #include "chromeos/chromeos_switches.h" 52 #include "chromeos/chromeos_switches.h"
52 #endif 53 #endif
53 54
54 using extensions::Extension; 55 using extensions::Extension;
55 using extensions::ExtensionCreator; 56 using extensions::ExtensionCreator;
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 ExtensionService* service = extensions::ExtensionSystem::Get( 546 ExtensionService* service = extensions::ExtensionSystem::Get(
546 profile())->extension_service(); 547 profile())->extension_service();
547 service->UnloadExtension(extension_id, 548 service->UnloadExtension(extension_id,
548 extensions::UnloadedExtensionInfo::REASON_DISABLE); 549 extensions::UnloadedExtensionInfo::REASON_DISABLE);
549 } 550 }
550 551
551 void ExtensionBrowserTest::UninstallExtension(const std::string& extension_id) { 552 void ExtensionBrowserTest::UninstallExtension(const std::string& extension_id) {
552 ExtensionService* service = extensions::ExtensionSystem::Get( 553 ExtensionService* service = extensions::ExtensionSystem::Get(
553 profile())->extension_service(); 554 profile())->extension_service();
554 service->UninstallExtension( 555 service->UninstallExtension(
555 extension_id, ExtensionService::UNINSTALL_REASON_FOR_TESTING, NULL); 556 extension_id, extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
556 } 557 }
557 558
558 void ExtensionBrowserTest::DisableExtension(const std::string& extension_id) { 559 void ExtensionBrowserTest::DisableExtension(const std::string& extension_id) {
559 ExtensionService* service = extensions::ExtensionSystem::Get( 560 ExtensionService* service = extensions::ExtensionSystem::Get(
560 profile())->extension_service(); 561 profile())->extension_service();
561 service->DisableExtension(extension_id, Extension::DISABLE_USER_ACTION); 562 service->DisableExtension(extension_id, Extension::DISABLE_USER_ACTION);
562 } 563 }
563 564
564 void ExtensionBrowserTest::EnableExtension(const std::string& extension_id) { 565 void ExtensionBrowserTest::EnableExtension(const std::string& extension_id) {
565 ExtensionService* service = extensions::ExtensionSystem::Get( 566 ExtensionService* service = extensions::ExtensionSystem::Get(
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( 643 return extensions::browsertest_util::ExecuteScriptInBackgroundPage(
643 profile(), extension_id, script); 644 profile(), extension_id, script);
644 } 645 }
645 646
646 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( 647 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait(
647 const std::string& extension_id, 648 const std::string& extension_id,
648 const std::string& script) { 649 const std::string& script) {
649 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( 650 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait(
650 profile(), extension_id, script); 651 profile(), extension_id, script);
651 } 652 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/error_console/error_console.cc ('k') | chrome/browser/extensions/extension_context_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698