| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/notifications/notification_channels_provider_android.h" | 5 #include "chrome/browser/notifications/notification_channels_provider_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 12 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "components/content_settings/core/browser/content_settings_details.h" | 14 #include "components/content_settings/core/browser/content_settings_details.h" |
| 15 #include "components/content_settings/core/browser/content_settings_rule.h" | 15 #include "components/content_settings/core/browser/content_settings_rule.h" |
| 16 #include "components/content_settings/core/browser/content_settings_utils.h" | 16 #include "components/content_settings/core/browser/content_settings_utils.h" |
| 17 #include "components/content_settings/core/browser/host_content_settings_map.h" | 17 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 18 #include "components/content_settings/core/common/content_settings.h" | 18 #include "components/content_settings/core/common/content_settings.h" |
| 19 #include "components/content_settings/core/common/content_settings_pattern.h" | 19 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 20 #include "components/content_settings/core/common/content_settings_utils.h" |
| 20 #include "jni/NotificationSettingsBridge_jni.h" | 21 #include "jni/NotificationSettingsBridge_jni.h" |
| 21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
| 22 #include "url/origin.h" | 23 #include "url/origin.h" |
| 23 #include "url/url_constants.h" | 24 #include "url/url_constants.h" |
| 24 | 25 |
| 25 using base::android::AttachCurrentThread; | 26 using base::android::AttachCurrentThread; |
| 26 using base::android::ConvertUTF8ToJavaString; | 27 using base::android::ConvertUTF8ToJavaString; |
| 27 using base::android::ScopedJavaLocalRef; | 28 using base::android::ScopedJavaLocalRef; |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 if (old_channel_status == NotificationChannelStatus::UNAVAILABLE) { | 205 if (old_channel_status == NotificationChannelStatus::UNAVAILABLE) { |
| 205 bridge_->CreateChannel( | 206 bridge_->CreateChannel( |
| 206 origin_string, | 207 origin_string, |
| 207 new_channel_status == NotificationChannelStatus::ENABLED); | 208 new_channel_status == NotificationChannelStatus::ENABLED); |
| 208 } else { | 209 } else { |
| 209 // TODO(awdf): Maybe remove this DCHECK - channel status could change any | 210 // TODO(awdf): Maybe remove this DCHECK - channel status could change any |
| 210 // time so this may be vulnerable to a race condition. | 211 // time so this may be vulnerable to a race condition. |
| 211 DCHECK(old_channel_status == new_channel_status); | 212 DCHECK(old_channel_status == new_channel_status); |
| 212 } | 213 } |
| 213 } | 214 } |
| OLD | NEW |