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

Side by Side Diff: chrome/browser/permissions/permission_queue_controller.cc

Issue 1164073005: Allow script to request durable storage permission (chrome side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix conflicts after midi constant permission landed Created 5 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
« no previous file with comments | « chrome/browser/permissions/permission_manager.cc ('k') | chrome/browser/storage/OWNERS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/permissions/permission_queue_controller.h" 5 #include "chrome/browser/permissions/permission_queue_controller.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/geolocation/geolocation_infobar_delegate.h" 9 #include "chrome/browser/geolocation/geolocation_infobar_delegate.h"
10 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
11 #include "chrome/browser/media/midi_permission_infobar_delegate.h" 11 #include "chrome/browser/media/midi_permission_infobar_delegate.h"
12 #include "chrome/browser/notifications/notification_permission_infobar_delegate. h" 12 #include "chrome/browser/notifications/notification_permission_infobar_delegate. h"
13 #include "chrome/browser/permissions/permission_context_uma_util.h" 13 #include "chrome/browser/permissions/permission_context_uma_util.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/storage/durable_storage_permission_infobar_delegate.h"
15 #include "chrome/browser/tab_contents/tab_util.h" 16 #include "chrome/browser/tab_contents/tab_util.h"
16 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
17 #include "components/content_settings/core/browser/host_content_settings_map.h" 18 #include "components/content_settings/core/browser/host_content_settings_map.h"
18 #include "components/content_settings/core/common/content_settings.h" 19 #include "components/content_settings/core/common/content_settings.h"
19 #include "components/infobars/core/infobar.h" 20 #include "components/infobars/core/infobar.h"
20 #include "content/public/browser/browser_thread.h" 21 #include "content/public/browser/browser_thread.h"
21 #include "content/public/browser/notification_details.h" 22 #include "content/public/browser/notification_details.h"
22 #include "content/public/browser/notification_source.h" 23 #include "content/public/browser/notification_source.h"
23 #include "content/public/browser/notification_types.h" 24 #include "content/public/browser/notification_types.h"
24 #include "content/public/browser/web_contents.h" 25 #include "content/public/browser/web_contents.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 GetInfoBarService(id_), controller, id_, requesting_frame_, 131 GetInfoBarService(id_), controller, id_, requesting_frame_,
131 display_languages, type_); 132 display_languages, type_);
132 break; 133 break;
133 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) 134 #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
134 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER: 135 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER:
135 infobar_ = ProtectedMediaIdentifierInfoBarDelegate::Create( 136 infobar_ = ProtectedMediaIdentifierInfoBarDelegate::Create(
136 GetInfoBarService(id_), controller, id_, requesting_frame_, 137 GetInfoBarService(id_), controller, id_, requesting_frame_,
137 display_languages); 138 display_languages);
138 break; 139 break;
139 #endif 140 #endif
141 case CONTENT_SETTINGS_TYPE_DURABLE_STORAGE:
142 infobar_ = DurableStoragePermissionInfoBarDelegate::Create(
143 GetInfoBarService(id_), controller, id_, requesting_frame_,
144 display_languages, type_);
145 break;
140 default: 146 default:
141 NOTREACHED(); 147 NOTREACHED();
142 break; 148 break;
143 } 149 }
144 } 150 }
145 151
146 152
147 PermissionQueueController::PermissionQueueController(Profile* profile, 153 PermissionQueueController::PermissionQueueController(Profile* profile,
148 ContentSettingsType type) 154 ContentSettingsType type)
149 : profile_(profile), 155 : profile_(profile),
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 ContentSettingsPattern::Wildcard() : 397 ContentSettingsPattern::Wildcard() :
392 ContentSettingsPattern::FromURLNoWildcard(embedder.GetOrigin()); 398 ContentSettingsPattern::FromURLNoWildcard(embedder.GetOrigin());
393 399
394 profile_->GetHostContentSettingsMap()->SetContentSetting( 400 profile_->GetHostContentSettingsMap()->SetContentSetting(
395 ContentSettingsPattern::FromURLNoWildcard(requesting_frame.GetOrigin()), 401 ContentSettingsPattern::FromURLNoWildcard(requesting_frame.GetOrigin()),
396 embedder_pattern, 402 embedder_pattern,
397 type_, 403 type_,
398 std::string(), 404 std::string(),
399 content_setting); 405 content_setting);
400 } 406 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_manager.cc ('k') | chrome/browser/storage/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698