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

Side by Side Diff: chrome/browser/search/hotword_service.cc

Issue 421193002: Fix ExtensionServiceTest.ClearExtensionData flakiness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use base::DoNothing for empty callbacks Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/policy/policy_browsertest.cc ('k') | chrome/browser/themes/theme_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/search/hotword_service.h" 5 #include "chrome/browser/search/hotword_service.h"
6 6
7 #include "base/i18n/case_conversion.h" 7 #include "base/i18n/case_conversion.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 358
359 return UninstallHotwordExtension(extension_service); 359 return UninstallHotwordExtension(extension_service);
360 } 360 }
361 361
362 bool HotwordService::UninstallHotwordExtension( 362 bool HotwordService::UninstallHotwordExtension(
363 ExtensionService* extension_service) { 363 ExtensionService* extension_service) {
364 base::string16 error; 364 base::string16 error;
365 if (!extension_service->UninstallExtension( 365 if (!extension_service->UninstallExtension(
366 extension_misc::kHotwordExtensionId, 366 extension_misc::kHotwordExtensionId,
367 extensions::UNINSTALL_REASON_INTERNAL_MANAGEMENT, 367 extensions::UNINSTALL_REASON_INTERNAL_MANAGEMENT,
368 base::Bind(&base::DoNothing),
368 &error)) { 369 &error)) {
369 LOG(WARNING) << "Cannot uninstall extension with id " 370 LOG(WARNING) << "Cannot uninstall extension with id "
370 << extension_misc::kHotwordExtensionId 371 << extension_misc::kHotwordExtensionId
371 << ": " << error; 372 << ": " << error;
372 reinstall_pending_ = false; 373 reinstall_pending_ = false;
373 return false; 374 return false;
374 } 375 }
375 return true; 376 return true;
376 } 377 }
377 378
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 return false; 503 return false;
503 504
504 std::string previous_locale = 505 std::string previous_locale =
505 profile_->GetPrefs()->GetString(prefs::kHotwordPreviousLanguage); 506 profile_->GetPrefs()->GetString(prefs::kHotwordPreviousLanguage);
506 std::string locale = GetCurrentLocale(profile_); 507 std::string locale = GetCurrentLocale(profile_);
507 508
508 // If it's a new locale, then the old extension should be uninstalled. 509 // If it's a new locale, then the old extension should be uninstalled.
509 return locale != previous_locale && 510 return locale != previous_locale &&
510 HotwordService::DoesHotwordSupportLanguage(profile_); 511 HotwordService::DoesHotwordSupportLanguage(profile_);
511 } 512 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_browsertest.cc ('k') | chrome/browser/themes/theme_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698