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

Side by Side Diff: chrome/browser/browser_init.cc

Issue 149619: Various minor extension fixes (Closed)
Patch Set: One more test Created 11 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/browser_init.h" 5 #include "chrome/browser/browser_init.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include "app/win_util.h" 8 #include "app/win_util.h"
9 #endif 9 #endif
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 } else { 690 } else {
691 expected_tab_count = 691 expected_tab_count =
692 std::max(1, static_cast<int>(command_line.GetLooseValues().size())); 692 std::max(1, static_cast<int>(command_line.GetLooseValues().size()));
693 } 693 }
694 CreateAutomationProvider<TestingAutomationProvider>( 694 CreateAutomationProvider<TestingAutomationProvider>(
695 testing_channel_id, 695 testing_channel_id,
696 profile, 696 profile,
697 static_cast<size_t>(expected_tab_count)); 697 static_cast<size_t>(expected_tab_count));
698 } 698 }
699 699
700 // Extension should be loaded from path which is specified by flag
701 // |kLoadExtension| once and only when the browser process is starting up.
702 if (command_line.HasSwitch(switches::kLoadExtension)) {
703 std::wstring path_string =
704 command_line.GetSwitchValue(switches::kLoadExtension);
705 FilePath path = FilePath::FromWStringHack(path_string);
706 profile->GetExtensionsService()->LoadExtension(path);
707 profile->GetUserScriptMaster()->AddWatchedPath(path);
708 }
709
710 if (command_line.HasSwitch(switches::kPackExtension)) { 700 if (command_line.HasSwitch(switches::kPackExtension)) {
711 // Input Paths. 701 // Input Paths.
712 FilePath src_dir = FilePath::FromWStringHack(command_line.GetSwitchValue( 702 FilePath src_dir = FilePath::FromWStringHack(command_line.GetSwitchValue(
713 switches::kPackExtension)); 703 switches::kPackExtension));
714 FilePath private_key_path; 704 FilePath private_key_path;
715 if (command_line.HasSwitch(switches::kPackExtensionKey)) { 705 if (command_line.HasSwitch(switches::kPackExtensionKey)) {
716 private_key_path = FilePath::FromWStringHack( 706 private_key_path = FilePath::FromWStringHack(
717 command_line.GetSwitchValue(switches::kPackExtensionKey)); 707 command_line.GetSwitchValue(switches::kPackExtensionKey));
718 } 708 }
719 709
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 scoped_refptr<AutomationProviderClass> automation = 797 scoped_refptr<AutomationProviderClass> automation =
808 new AutomationProviderClass(profile); 798 new AutomationProviderClass(profile);
809 automation->ConnectToChannel(channel_id); 799 automation->ConnectToChannel(channel_id);
810 automation->SetExpectedTabCount(expected_tabs); 800 automation->SetExpectedTabCount(expected_tabs);
811 801
812 AutomationProviderList* list = 802 AutomationProviderList* list =
813 g_browser_process->InitAutomationProviderList(); 803 g_browser_process->InitAutomationProviderList();
814 DCHECK(list); 804 DCHECK(list);
815 list->AddProvider(automation); 805 list->AddProvider(automation);
816 } 806 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698