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

Side by Side Diff: chrome/browser/spellchecker/spellcheck_custom_dictionary.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 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
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/spellchecker/spellcheck_custom_dictionary.h" 5 #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8
8 #include <functional> 9 #include <functional>
9 #include <utility> 10 #include <utility>
10 11
11 #include "base/files/file_util.h" 12 #include "base/files/file_util.h"
12 #include "base/files/important_file_writer.h" 13 #include "base/files/important_file_writer.h"
13 #include "base/md5.h" 14 #include "base/md5.h"
14 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/string_split.h" 16 #include "base/strings/string_split.h"
16 #include "base/strings/string_util.h" 17 #include "base/strings/string_util.h"
17 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" 18 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h"
18 #include "chrome/common/chrome_constants.h" 19 #include "chrome/common/chrome_constants.h"
19 #include "components/spellcheck/common/spellcheck_common.h" 20 #include "components/spellcheck/common/spellcheck_common.h"
21 #include "components/sync/api/sync_change.h"
22 #include "components/sync/api/sync_error_factory.h"
23 #include "components/sync/protocol/sync.pb.h"
20 #include "content/public/browser/browser_thread.h" 24 #include "content/public/browser/browser_thread.h"
21 #include "sync/api/sync_change.h"
22 #include "sync/api/sync_error_factory.h"
23 #include "sync/protocol/sync.pb.h"
24 25
25 using content::BrowserThread; 26 using content::BrowserThread;
26 27
27 namespace { 28 namespace {
28 29
29 // Filename extension for backup dictionary file. 30 // Filename extension for backup dictionary file.
30 const base::FilePath::CharType BACKUP_EXTENSION[] = FILE_PATH_LITERAL("backup"); 31 const base::FilePath::CharType BACKUP_EXTENSION[] = FILE_PATH_LITERAL("backup");
31 32
32 // Prefix for the checksum in the dictionary file. 33 // Prefix for the checksum in the dictionary file.
33 const char CHECKSUM_PREFIX[] = "checksum_v1 = "; 34 const char CHECKSUM_PREFIX[] = "checksum_v1 = ";
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 } 519 }
519 520
520 void SpellcheckCustomDictionary::Notify(const Change& dictionary_change) { 521 void SpellcheckCustomDictionary::Notify(const Change& dictionary_change) {
521 DCHECK_CURRENTLY_ON(BrowserThread::UI); 522 DCHECK_CURRENTLY_ON(BrowserThread::UI);
522 if (!IsLoaded() || dictionary_change.empty()) 523 if (!IsLoaded() || dictionary_change.empty())
523 return; 524 return;
524 FOR_EACH_OBSERVER(Observer, 525 FOR_EACH_OBSERVER(Observer,
525 observers_, 526 observers_,
526 OnCustomDictionaryChanged(dictionary_change)); 527 OnCustomDictionaryChanged(dictionary_change));
527 } 528 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698