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

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

Issue 9310079: Moved app shortcut code out of ExtensionService. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed unneeded includes Created 8 years, 10 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_path.h" 10 #include "base/file_path.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 command_line->AppendSwitchASCII(switches::kLoginUser, 54 command_line->AppendSwitchASCII(switches::kLoginUser,
55 "TestUser@gmail.com"); 55 "TestUser@gmail.com");
56 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); 56 command_line->AppendSwitchASCII(switches::kLoginProfile, "user");
57 command_line->AppendSwitch(switches::kNoFirstRun); 57 command_line->AppendSwitch(switches::kNoFirstRun);
58 #endif 58 #endif
59 } 59 }
60 60
61 const Extension* ExtensionBrowserTest::LoadExtensionWithOptions( 61 const Extension* ExtensionBrowserTest::LoadExtensionWithOptions(
62 const FilePath& path, bool incognito_enabled, bool fileaccess_enabled) { 62 const FilePath& path, bool incognito_enabled, bool fileaccess_enabled) {
63 ExtensionService* service = browser()->profile()->GetExtensionService(); 63 ExtensionService* service = browser()->profile()->GetExtensionService();
64 service->app_shortcut_manager()->set_disable_shortcut_creation(true);
64 { 65 {
65 content::NotificationRegistrar registrar; 66 content::NotificationRegistrar registrar;
66 registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 67 registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
67 content::NotificationService::AllSources()); 68 content::NotificationService::AllSources());
68 scoped_refptr<extensions::UnpackedInstaller> installer( 69 scoped_refptr<extensions::UnpackedInstaller> installer(
69 extensions::UnpackedInstaller::Create(service)); 70 extensions::UnpackedInstaller::Create(service));
70 installer->set_prompt_for_plugins(false); 71 installer->set_prompt_for_plugins(false);
71 installer->Load(path); 72 installer->Load(path);
72 ui_test_utils::RunMessageLoop(); 73 ui_test_utils::RunMessageLoop();
73 } 74 }
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 255
255 const Extension* ExtensionBrowserTest::InstallOrUpdateExtension( 256 const Extension* ExtensionBrowserTest::InstallOrUpdateExtension(
256 const std::string& id, 257 const std::string& id,
257 const FilePath& path, 258 const FilePath& path,
258 InstallUIType ui_type, 259 InstallUIType ui_type,
259 int expected_change, 260 int expected_change,
260 Profile* profile, 261 Profile* profile,
261 bool from_webstore) { 262 bool from_webstore) {
262 ExtensionService* service = profile->GetExtensionService(); 263 ExtensionService* service = profile->GetExtensionService();
263 service->set_show_extensions_prompts(false); 264 service->set_show_extensions_prompts(false);
265 service->app_shortcut_manager()->set_disable_shortcut_creation(true);
Aaron Boodman 2012/02/05 05:45:27 A better chokepoint might be ExtensionBrowserTest'
benwells 2012/02/06 05:01:48 When the test is being constructed there is no bro
benwells 2012/02/07 06:57:01 I've changed how the disabling works, its now done
264 size_t num_before = service->extensions()->size(); 266 size_t num_before = service->extensions()->size();
265 267
266 { 268 {
267 ExtensionInstallUI* install_ui = NULL; 269 ExtensionInstallUI* install_ui = NULL;
268 if (ui_type == INSTALL_UI_TYPE_CANCEL) 270 if (ui_type == INSTALL_UI_TYPE_CANCEL)
269 install_ui = new MockAbortExtensionInstallUI(); 271 install_ui = new MockAbortExtensionInstallUI();
270 else if (ui_type == INSTALL_UI_TYPE_NORMAL) 272 else if (ui_type == INSTALL_UI_TYPE_NORMAL)
271 install_ui = new ExtensionInstallUI(profile); 273 install_ui = new ExtensionInstallUI(profile);
272 else if (ui_type == INSTALL_UI_TYPE_AUTO_CONFIRM) 274 else if (ui_type == INSTALL_UI_TYPE_AUTO_CONFIRM)
273 install_ui = new MockAutoConfirmExtensionInstallUI(profile); 275 install_ui = new MockAutoConfirmExtensionInstallUI(profile);
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 MessageLoopForUI::current()->Quit(); 506 MessageLoopForUI::current()->Quit();
505 } 507 }
506 break; 508 break;
507 } 509 }
508 510
509 default: 511 default:
510 NOTREACHED(); 512 NOTREACHED();
511 break; 513 break;
512 } 514 }
513 } 515 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698