diff options
Diffstat (limited to 'chrome')
14 files changed, 52 insertions, 84 deletions
diff --git a/chrome/browser/content_settings/host_content_settings_map_unittest.cc b/chrome/browser/content_settings/host_content_settings_map_unittest.cc index 0018d7f..4982529 100644 --- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc +++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc @@ -914,36 +914,32 @@ TEST_F(HostContentSettingsMapTest, GetContentSetting) { } TEST_F(HostContentSettingsMapTest, ShouldAllowAllContent) { - TestingProfile profile; - HostContentSettingsMap* host_content_settings_map = - profile.GetHostContentSettingsMap(); - GURL http_host("http://example.com/"); GURL https_host("https://example.com/"); GURL embedder("chrome://foo"); GURL extension("chrome-extension://foo"); - EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent( + EXPECT_FALSE(HostContentSettingsMap::ShouldAllowAllContent( http_host, embedder, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)); - EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent( + EXPECT_FALSE(HostContentSettingsMap::ShouldAllowAllContent( http_host, embedder, CONTENT_SETTINGS_TYPE_GEOLOCATION)); - EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent( + EXPECT_FALSE(HostContentSettingsMap::ShouldAllowAllContent( http_host, embedder, CONTENT_SETTINGS_TYPE_COOKIES)); - EXPECT_TRUE(host_content_settings_map->ShouldAllowAllContent( + EXPECT_TRUE(HostContentSettingsMap::ShouldAllowAllContent( https_host, embedder, CONTENT_SETTINGS_TYPE_COOKIES)); - EXPECT_TRUE(host_content_settings_map->ShouldAllowAllContent( + EXPECT_TRUE(HostContentSettingsMap::ShouldAllowAllContent( https_host, embedder, CONTENT_SETTINGS_TYPE_COOKIES)); - EXPECT_TRUE(host_content_settings_map->ShouldAllowAllContent( + EXPECT_TRUE(HostContentSettingsMap::ShouldAllowAllContent( embedder, http_host, CONTENT_SETTINGS_TYPE_COOKIES)); #if defined(ENABLE_EXTENSIONS) - EXPECT_TRUE(host_content_settings_map->ShouldAllowAllContent( + EXPECT_TRUE(HostContentSettingsMap::ShouldAllowAllContent( extension, extension, CONTENT_SETTINGS_TYPE_COOKIES)); #else - EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent( + EXPECT_FALSE(HostContentSettingsMap::ShouldAllowAllContent( extension, extension, CONTENT_SETTINGS_TYPE_COOKIES)); #endif - EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent( + EXPECT_FALSE(HostContentSettingsMap::ShouldAllowAllContent( extension, extension, CONTENT_SETTINGS_TYPE_PLUGINS)); - EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent( + EXPECT_FALSE(HostContentSettingsMap::ShouldAllowAllContent( extension, http_host, CONTENT_SETTINGS_TYPE_COOKIES)); } diff --git a/chrome/browser/enumerate_modules_model_win.cc b/chrome/browser/enumerate_modules_model_win.cc index d66730f..e69f37f 100644 --- a/chrome/browser/enumerate_modules_model_win.cc +++ b/chrome/browser/enumerate_modules_model_win.cc @@ -979,8 +979,6 @@ void EnumerateModulesModel::MaybePostScanningTask() { static bool done = false; if (!done) { done = true; - - const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); if (base::win::GetVersion() == base::win::VERSION_XP) { check_modules_timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kModuleCheckDelayMs), diff --git a/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc b/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc index eafd730..08f30be 100644 --- a/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc +++ b/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc @@ -336,10 +336,9 @@ IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, EXPECT_EQ(TRUE, ::IsWindow(hwnd)); // Create a new browser window to prevent the message loop from terminating. - Browser* new_browser = chrome::FindBrowserWithWebContents( - browser()->OpenURL(content::OpenURLParams( - GURL("about:"), content::Referrer(), NEW_WINDOW, - ui::PAGE_TRANSITION_TYPED, false))); + browser()->OpenURL(content::OpenURLParams(GURL("about:"), content::Referrer(), + NEW_WINDOW, + ui::PAGE_TRANSITION_TYPED, false)); // Forcibly closing the browser HWND should not cause a crash. EXPECT_EQ(TRUE, ::CloseWindow(hwnd)); diff --git a/chrome/browser/extensions/external_provider_impl.cc b/chrome/browser/extensions/external_provider_impl.cc index 963ccc4..6a84193 100644 --- a/chrome/browser/extensions/external_provider_impl.cc +++ b/chrome/browser/extensions/external_provider_impl.cc @@ -465,7 +465,9 @@ void ExternalProviderImpl::CreateExternalProviders( #endif bool is_chromeos_demo_session = false; +#if !defined(OS_WIN) int bundled_extension_creation_flags = Extension::NO_FLAGS; +#endif #if defined(OS_CHROMEOS) user_manager::UserManager* user_manager = user_manager::UserManager::Get(); is_chromeos_demo_session = @@ -473,26 +475,7 @@ void ExternalProviderImpl::CreateExternalProviders( connector->GetDeviceMode() == policy::DEVICE_MODE_RETAIL_KIOSK; bundled_extension_creation_flags = Extension::FROM_WEBSTORE | Extension::WAS_INSTALLED_BY_DEFAULT; -#endif -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) - if (!profile->IsSupervised()) { - provider_list->push_back( - linked_ptr<ExternalProviderInterface>( - new ExternalProviderImpl( - service, - new ExternalPrefLoader( - chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS, - ExternalPrefLoader::NONE, - NULL), - profile, - Manifest::EXTERNAL_PREF, - Manifest::EXTERNAL_PREF_DOWNLOAD, - bundled_extension_creation_flags))); - } -#endif - -#if defined(OS_CHROMEOS) if (!is_chromeos_demo_session && !is_chrome_os_public_session) { int external_apps_path_id = profile->IsSupervised() ? chrome::DIR_SUPERVISED_USERS_DEFAULT_APPS : @@ -538,10 +521,35 @@ void ExternalProviderImpl::CreateExternalProviders( Manifest::INVALID_LOCATION, Extension::NO_FLAGS))); } +#elif defined(OS_LINUX) + if (!profile->IsSupervised()) { + provider_list->push_back( + linked_ptr<ExternalProviderInterface>( + new ExternalProviderImpl( + service, + new ExternalPrefLoader( + chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS, + ExternalPrefLoader::NONE, + NULL), + profile, + Manifest::EXTERNAL_PREF, + Manifest::EXTERNAL_PREF_DOWNLOAD, + bundled_extension_creation_flags))); + } #endif if (!profile->IsSupervised() && !is_chromeos_demo_session) { -#if !defined(OS_WIN) +#if defined(OS_WIN) + provider_list->push_back( + linked_ptr<ExternalProviderInterface>( + new ExternalProviderImpl( + service, + new ExternalRegistryLoader, + profile, + Manifest::EXTERNAL_REGISTRY, + Manifest::EXTERNAL_PREF_DOWNLOAD, + Extension::NO_FLAGS))); +#else provider_list->push_back( linked_ptr<ExternalProviderInterface>( new ExternalProviderImpl( @@ -553,7 +561,6 @@ void ExternalProviderImpl::CreateExternalProviders( Manifest::EXTERNAL_PREF, Manifest::EXTERNAL_PREF_DOWNLOAD, bundled_extension_creation_flags))); -#endif // Define a per-user source of external extensions. #if defined(OS_MACOSX) @@ -569,17 +576,6 @@ void ExternalProviderImpl::CreateExternalProviders( Manifest::EXTERNAL_PREF_DOWNLOAD, Extension::NO_FLAGS))); #endif - -#if defined(OS_WIN) - provider_list->push_back( - linked_ptr<ExternalProviderInterface>( - new ExternalProviderImpl( - service, - new ExternalRegistryLoader, - profile, - Manifest::EXTERNAL_REGISTRY, - Manifest::EXTERNAL_PREF_DOWNLOAD, - Extension::NO_FLAGS))); #endif #if !defined(OS_CHROMEOS) diff --git a/chrome/browser/history/in_memory_url_index_unittest.cc b/chrome/browser/history/in_memory_url_index_unittest.cc index 2a79e0d..59f8a80 100644 --- a/chrome/browser/history/in_memory_url_index_unittest.cc +++ b/chrome/browser/history/in_memory_url_index_unittest.cc @@ -983,12 +983,11 @@ TEST_F(InMemoryURLIndexTest, WhitelistedURLs) { { "xmpp://guest@example.com", false }, }; - URLIndexPrivateData& private_data(*GetPrivateData()); const std::set<std::string>& whitelist(scheme_whitelist()); for (size_t i = 0; i < arraysize(data); ++i) { GURL url(data[i].url_spec); EXPECT_EQ(data[i].expected_is_whitelisted, - private_data.URLSchemeIsWhitelisted(url, whitelist)); + URLIndexPrivateData::URLSchemeIsWhitelisted(url, whitelist)); } } diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc index 122e83d..960d6d8 100644 --- a/chrome/browser/process_singleton_win.cc +++ b/chrome/browser/process_singleton_win.cc @@ -160,7 +160,6 @@ bool ProcessLaunchNotification( return false; // Handle the WM_COPYDATA message from another process. - HWND hwnd = reinterpret_cast<HWND>(wparam); const COPYDATASTRUCT* cds = reinterpret_cast<COPYDATASTRUCT*>(lparam); CommandLine parsed_command_line(CommandLine::NO_PROGRAM); diff --git a/chrome/browser/search/hotword_service_unittest.cc b/chrome/browser/search/hotword_service_unittest.cc index c35932e..8d62047 100644 --- a/chrome/browser/search/hotword_service_unittest.cc +++ b/chrome/browser/search/hotword_service_unittest.cc @@ -117,13 +117,10 @@ TEST_P(HotwordServiceTest, IsHotwordAllowedBadFieldTrial) { TestingProfile::Builder profile_builder; scoped_ptr<TestingProfile> profile = profile_builder.Build(); - HotwordServiceFactory* hotword_service_factory = - HotwordServiceFactory::GetInstance(); - // Check that the service exists so that a NULL service be ruled out in // following tests. HotwordService* hotword_service = - hotword_service_factory->GetForProfile(profile.get()); + HotwordServiceFactory::GetForProfile(profile.get()); EXPECT_TRUE(hotword_service != NULL); // When the field trial is empty or Disabled, it should not be allowed. @@ -137,7 +134,7 @@ TEST_P(HotwordServiceTest, IsHotwordAllowedBadFieldTrial) { hotword_internal::kHotwordFieldTrialDisabledGroupName)); group = base::FieldTrialList::FindFullName( hotword_internal::kHotwordFieldTrialName); - EXPECT_TRUE(group ==hotword_internal::kHotwordFieldTrialDisabledGroupName); + EXPECT_TRUE(group == hotword_internal::kHotwordFieldTrialDisabledGroupName); EXPECT_FALSE(HotwordServiceFactory::IsHotwordAllowed(profile.get())); // Set a valid locale with invalid field trial to be sure it is @@ -154,13 +151,10 @@ TEST_P(HotwordServiceTest, IsHotwordAllowedLocale) { TestingProfile::Builder profile_builder; scoped_ptr<TestingProfile> profile = profile_builder.Build(); - HotwordServiceFactory* hotword_service_factory = - HotwordServiceFactory::GetInstance(); - // Check that the service exists so that a NULL service be ruled out in // following tests. HotwordService* hotword_service = - hotword_service_factory->GetForProfile(profile.get()); + HotwordServiceFactory::GetForProfile(profile.get()); EXPECT_TRUE(hotword_service != NULL); // Set the field trial to a valid one. @@ -194,10 +188,8 @@ TEST_P(HotwordServiceTest, AudioLoggingPrefSetCorrectly) { TestingProfile::Builder profile_builder; scoped_ptr<TestingProfile> profile = profile_builder.Build(); - HotwordServiceFactory* hotword_service_factory = - HotwordServiceFactory::GetInstance(); HotwordService* hotword_service = - hotword_service_factory->GetForProfile(profile.get()); + HotwordServiceFactory::GetForProfile(profile.get()); EXPECT_TRUE(hotword_service != NULL); // If it's a fresh profile, although the default value is true, diff --git a/chrome/browser/search/suggestions/suggestions_source.cc b/chrome/browser/search/suggestions/suggestions_source.cc index a79589a..486d53d 100644 --- a/chrome/browser/search/suggestions/suggestions_source.cc +++ b/chrome/browser/search/suggestions/suggestions_source.cc @@ -116,11 +116,8 @@ std::string SuggestionsSource::GetSource() const { void SuggestionsSource::StartDataRequest( const std::string& path, int render_process_id, int render_frame_id, const content::URLDataSource::GotDataCallback& callback) { - SuggestionsServiceFactory* suggestions_service_factory = - SuggestionsServiceFactory::GetInstance(); - - SuggestionsService* suggestions_service( - suggestions_service_factory->GetForProfile(profile_)); + SuggestionsService* suggestions_service = + SuggestionsServiceFactory::GetForProfile(profile_); if (!suggestions_service) { callback.Run(NULL); diff --git a/chrome/browser/ui/views/certificate_viewer_win.cc b/chrome/browser/ui/views/certificate_viewer_win.cc index 9390358..2ae3675 100644 --- a/chrome/browser/ui/views/certificate_viewer_win.cc +++ b/chrome/browser/ui/views/certificate_viewer_win.cc @@ -45,7 +45,7 @@ void ShowCertificateViewerImpl(content::WebContents* web_contents, base::MessageLoop::current()); // This next call blocks but keeps processing windows messages, making it // modal to the browser window. - BOOL rv = ::CryptUIDlgViewCertificate(&view_info, &properties_changed); + ::CryptUIDlgViewCertificate(&view_info, &properties_changed); CertFreeCertificateContext(cert_list); } diff --git a/chrome/browser/ui/views/panels/panel_frame_view.cc b/chrome/browser/ui/views/panels/panel_frame_view.cc index 6ebf539..02eaf41 100644 --- a/chrome/browser/ui/views/panels/panel_frame_view.cc +++ b/chrome/browser/ui/views/panels/panel_frame_view.cc @@ -351,7 +351,7 @@ void PanelFrameView::SetWindowCornerStyle(panel::CornerStyle corner_style) { // window region if the region really differs. HWND native_window = views::HWNDForWidget(panel_view_->window()); base::win::ScopedRegion current_region(::CreateRectRgn(0, 0, 0, 0)); - int current_region_result = ::GetWindowRgn(native_window, current_region); + ::GetWindowRgn(native_window, current_region); gfx::Path window_mask; GetWindowMask(size(), &window_mask); diff --git a/chrome/browser/ui/webui/sync_internals_message_handler.cc b/chrome/browser/ui/webui/sync_internals_message_handler.cc index fa21977..996bf4c 100644 --- a/chrome/browser/ui/webui/sync_internals_message_handler.cc +++ b/chrome/browser/ui/webui/sync_internals_message_handler.cc @@ -221,6 +221,6 @@ void SyncInternalsMessageHandler::SendAboutInfo() { // May return NULL (e.g., if sync is disabled on the command line). ProfileSyncService* SyncInternalsMessageHandler::GetProfileSyncService() { Profile* profile = Profile::FromWebUI(web_ui()); - ProfileSyncServiceFactory* factory = ProfileSyncServiceFactory::GetInstance(); - return factory->GetForProfile(profile->GetOriginalProfile()); + return ProfileSyncServiceFactory::GetForProfile( + profile->GetOriginalProfile()); } diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index b02be69..4cd2256 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -1532,7 +1532,6 @@ InstallStatus InstallProductsHelper( COMPILE_ASSERT(BrowserDistribution::NUM_TYPES == 4, add_support_for_new_products_here_); const uint32 kBrowserBit = 1 << BrowserDistribution::CHROME_BROWSER; - const uint32 kAppHostBit = 1 << BrowserDistribution::CHROME_APP_HOST; int message_id = 0; proceed_with_installation = false; diff --git a/chrome/installer/util/installation_validator.cc b/chrome/installer/util/installation_validator.cc index 6a982b8..be5959a 100644 --- a/chrome/installer/util/installation_validator.cc +++ b/chrome/installer/util/installation_validator.cc @@ -29,9 +29,6 @@ BrowserDistribution::Type void InstallationValidator::ChromeRules::AddUninstallSwitchExpectations( const ProductContext& ctx, SwitchExpectations* expectations) const { - const bool is_multi_install = - ctx.state.uninstall_command().HasSwitch(switches::kMultiInstall); - // --chrome should be present for uninstall iff --multi-install. This wasn't // the case in Chrome 10 (between r68996 and r72497), though, so consider it // optional. @@ -40,9 +37,6 @@ void InstallationValidator::ChromeRules::AddUninstallSwitchExpectations( void InstallationValidator::ChromeRules::AddRenameSwitchExpectations( const ProductContext& ctx, SwitchExpectations* expectations) const { - const bool is_multi_install = - ctx.state.uninstall_command().HasSwitch(switches::kMultiInstall); - // --chrome should not be present for rename. It was for a time, so we'll be // lenient so that mini_installer tests pass. diff --git a/chrome/installer/util/installer_state_unittest.cc b/chrome/installer/util/installer_state_unittest.cc index e9a19a4b..4faaee0 100644 --- a/chrome/installer/util/installer_state_unittest.cc +++ b/chrome/installer/util/installer_state_unittest.cc @@ -374,7 +374,6 @@ TEST_F(InstallerStateTest, WithProduct) { TEST_F(InstallerStateTest, InstallerResult) { const bool system_level = true; - bool multi_install = false; HKEY root = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; RegKey key; |