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

Side by Side Diff: chrome/browser/notifications/notification_channels_provider_android.cc

Issue 2938163002: Store base::Value in ContentSettingPatternSource instead of an enum (Closed)
Patch Set: ps Created 3 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
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698