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

Side by Side Diff: chrome/browser/search_engines/template_url_service.cc

Issue 10540003: Move guid generation from chrome/common/ to base/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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
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/search_engines/template_url_service.h" 5 #include "chrome/browser/search_engines/template_url_service.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/guid.h"
10 #include "base/i18n/case_conversion.h" 11 #include "base/i18n/case_conversion.h"
11 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
12 #include "base/stl_util.h" 13 #include "base/stl_util.h"
13 #include "base/string_number_conversions.h" 14 #include "base/string_number_conversions.h"
14 #include "base/string_split.h" 15 #include "base/string_split.h"
15 #include "base/string_util.h" 16 #include "base/string_util.h"
16 #include "base/threading/thread_restrictions.h" 17 #include "base/threading/thread_restrictions.h"
17 #include "base/utf_string_conversions.h" 18 #include "base/utf_string_conversions.h"
18 #include "chrome/browser/extensions/extension_service.h" 19 #include "chrome/browser/extensions/extension_service.h"
19 #include "chrome/browser/google/google_url_tracker.h" 20 #include "chrome/browser/google/google_url_tracker.h"
(...skipping 11 matching lines...) Expand all
31 #include "chrome/browser/search_engines/search_terms_data.h" 32 #include "chrome/browser/search_engines/search_terms_data.h"
32 #include "chrome/browser/search_engines/template_url.h" 33 #include "chrome/browser/search_engines/template_url.h"
33 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" 34 #include "chrome/browser/search_engines/template_url_prepopulate_data.h"
34 #include "chrome/browser/search_engines/template_url_service_observer.h" 35 #include "chrome/browser/search_engines/template_url_service_observer.h"
35 #include "chrome/browser/search_engines/util.h" 36 #include "chrome/browser/search_engines/util.h"
36 #include "chrome/browser/webdata/web_data_service_factory.h" 37 #include "chrome/browser/webdata/web_data_service_factory.h"
37 #include "chrome/common/chrome_notification_types.h" 38 #include "chrome/common/chrome_notification_types.h"
38 #include "chrome/common/chrome_switches.h" 39 #include "chrome/common/chrome_switches.h"
39 #include "chrome/common/env_vars.h" 40 #include "chrome/common/env_vars.h"
40 #include "chrome/common/extensions/extension.h" 41 #include "chrome/common/extensions/extension.h"
41 #include "chrome/common/guid.h"
42 #include "chrome/common/pref_names.h" 42 #include "chrome/common/pref_names.h"
43 #include "chrome/common/url_constants.h" 43 #include "chrome/common/url_constants.h"
44 #include "content/public/browser/notification_service.h" 44 #include "content/public/browser/notification_service.h"
45 #include "net/base/net_util.h" 45 #include "net/base/net_util.h"
46 #include "sync/api/sync_change.h" 46 #include "sync/api/sync_change.h"
47 #include "sync/api/sync_error_factory.h" 47 #include "sync/api/sync_error_factory.h"
48 #include "sync/protocol/search_engine_specifics.pb.h" 48 #include "sync/protocol/search_engine_specifics.pb.h"
49 #include "sync/protocol/sync.pb.h" 49 #include "sync/protocol/sync.pb.h"
50 #include "ui/base/l10n/l10n_util.h" 50 #include "ui/base/l10n/l10n_util.h"
51 51
(...skipping 2218 matching lines...) Expand 10 before | Expand all | Expand 10 after
2270 // TODO(mpcomplete): If we allow editing extension keywords, then those 2270 // TODO(mpcomplete): If we allow editing extension keywords, then those
2271 // should be persisted to disk and synced. 2271 // should be persisted to disk and synced.
2272 if (template_url->sync_guid().empty() && 2272 if (template_url->sync_guid().empty() &&
2273 !template_url->IsExtensionKeyword()) { 2273 !template_url->IsExtensionKeyword()) {
2274 template_url->data_.sync_guid = guid::GenerateGUID(); 2274 template_url->data_.sync_guid = guid::GenerateGUID();
2275 if (service_.get()) 2275 if (service_.get())
2276 service_->UpdateKeyword(template_url->data()); 2276 service_->UpdateKeyword(template_url->data());
2277 } 2277 }
2278 } 2278 }
2279 } 2279 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698