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

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

Issue 1706503002: Add enterprise policy to turn off Bluetooth. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Sync Created 4 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_manager.h" 5 #include "chrome/browser/permissions/permission_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 #endif 77 #endif
78 case PermissionType::DURABLE_STORAGE: 78 case PermissionType::DURABLE_STORAGE:
79 return CONTENT_SETTINGS_TYPE_DURABLE_STORAGE; 79 return CONTENT_SETTINGS_TYPE_DURABLE_STORAGE;
80 case PermissionType::MIDI: 80 case PermissionType::MIDI:
81 // This will hit the NOTREACHED below. 81 // This will hit the NOTREACHED below.
82 break; 82 break;
83 case PermissionType::AUDIO_CAPTURE: 83 case PermissionType::AUDIO_CAPTURE:
84 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC; 84 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC;
85 case PermissionType::VIDEO_CAPTURE: 85 case PermissionType::VIDEO_CAPTURE:
86 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; 86 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA;
87 case PermissionType::BLUETOOTH_GUARD:
raymes 2016/02/22 22:34:34 I wonder if we should just call this BLUETOOTH?
Jeffrey Yasskin 2016/02/22 22:52:17 I picked BLUETOOTH_GUARD because it's not where th
88 return CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD;
87 case PermissionType::NUM: 89 case PermissionType::NUM:
88 // This will hit the NOTREACHED below. 90 // This will hit the NOTREACHED below.
89 break; 91 break;
90 } 92 }
91 93
92 NOTREACHED() << "Unknown content setting for permission " 94 NOTREACHED() << "Unknown content setting for permission "
93 << static_cast<int>(permission); 95 << static_cast<int>(permission);
94 return CONTENT_SETTINGS_TYPE_DEFAULT; 96 return CONTENT_SETTINGS_TYPE_DEFAULT;
95 } 97 }
96 98
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 // Add the callback to |callbacks| which will be run after the loop to 425 // Add the callback to |callbacks| which will be run after the loop to
424 // prevent re-entrance issues. 426 // prevent re-entrance issues.
425 callbacks.push_back( 427 callbacks.push_back(
426 base::Bind(subscription->callback, 428 base::Bind(subscription->callback,
427 ContentSettingToPermissionStatus(new_value))); 429 ContentSettingToPermissionStatus(new_value)));
428 } 430 }
429 431
430 for (const auto& callback : callbacks) 432 for (const auto& callback : callbacks)
431 callback.Run(); 433 callback.Run();
432 } 434 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698