OLD | NEW |
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/protector/protector_service.h" | 5 #include "chrome/browser/protector/protector_service.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/google/google_util.h" | 8 #include "chrome/browser/google/google_util.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/protector/composite_settings_change.h" | 10 #include "chrome/browser/protector/composite_settings_change.h" |
11 #include "chrome/browser/protector/keys.h" | 11 #include "chrome/browser/protector/keys.h" |
12 #include "chrome/browser/protector/protected_prefs_watcher.h" | 12 #include "chrome/browser/protector/protected_prefs_watcher.h" |
13 #include "chrome/browser/protector/protector_utils.h" | 13 #include "chrome/browser/protector/protector_utils.h" |
14 #include "chrome/browser/protector/settings_change_global_error.h" | 14 #include "chrome/browser/protector/settings_change_global_error.h" |
15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/singleton_tabs.h" | 16 #include "chrome/browser/ui/singleton_tabs.h" |
17 #include "chrome/common/chrome_notification_types.h" | 17 #include "chrome/common/chrome_notification_types.h" |
18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
19 #include "content/public/browser/notification_source.h" | 19 #include "content/public/browser/notification_source.h" |
20 #include "net/base/registry_controlled_domain.h" | 20 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
21 | 21 |
22 namespace protector { | 22 namespace protector { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 // Returns true if changes with URLs |url1| and |url2| can be merged. | 26 // Returns true if changes with URLs |url1| and |url2| can be merged. |
27 bool CanMerge(const GURL& url1, const GURL& url2) { | 27 bool CanMerge(const GURL& url1, const GURL& url2) { |
28 VLOG(1) << "Checking if can merge " << url1.spec() << " with " << url2.spec(); | 28 VLOG(1) << "Checking if can merge " << url1.spec() << " with " << url2.spec(); |
29 // All Google URLs are considered the same one. | 29 // All Google URLs are considered the same one. |
30 if (google_util::IsGoogleHostname(url1.host(), | 30 if (google_util::IsGoogleHostname(url1.host(), |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 ProtectorService::MatchItemByError::MatchItemByError( | 220 ProtectorService::MatchItemByError::MatchItemByError( |
221 const SettingsChangeGlobalError* other) : other_(other) { | 221 const SettingsChangeGlobalError* other) : other_(other) { |
222 } | 222 } |
223 | 223 |
224 bool ProtectorService::MatchItemByError::operator()( | 224 bool ProtectorService::MatchItemByError::operator()( |
225 const ProtectorService::Item& item) { | 225 const ProtectorService::Item& item) { |
226 return other_ == item.error.get(); | 226 return other_ == item.error.get(); |
227 } | 227 } |
228 | 228 |
229 } // namespace protector | 229 } // namespace protector |
OLD | NEW |