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

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

Issue 1942353002: (reland) Move permission.mojom from WebKit/public/platform/ to components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 20 matching lines...) Expand all
31 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) 31 #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
32 #include "chrome/browser/media/protected_media_identifier_permission_context.h" 32 #include "chrome/browser/media/protected_media_identifier_permission_context.h"
33 #endif 33 #endif
34 34
35 #if BUILDFLAG(ANDROID_JAVA_UI) 35 #if BUILDFLAG(ANDROID_JAVA_UI)
36 #include "chrome/browser/geolocation/geolocation_permission_context_android.h" 36 #include "chrome/browser/geolocation/geolocation_permission_context_android.h"
37 #else 37 #else
38 #include "chrome/browser/geolocation/geolocation_permission_context.h" 38 #include "chrome/browser/geolocation/geolocation_permission_context.h"
39 #endif 39 #endif
40 40
41 using blink::mojom::PermissionStatus; 41 using permissions::mojom::PermissionStatus;
42 using content::PermissionType; 42 using content::PermissionType;
43 43
44 namespace { 44 namespace {
45 45
46 // Helper method to convert ContentSetting to PermissionStatus. 46 // Helper method to convert ContentSetting to PermissionStatus.
47 PermissionStatus ContentSettingToPermissionStatus(ContentSetting setting) { 47 PermissionStatus ContentSettingToPermissionStatus(ContentSetting setting) {
48 switch (setting) { 48 switch (setting) {
49 case CONTENT_SETTING_ALLOW: 49 case CONTENT_SETTING_ALLOW:
50 case CONTENT_SETTING_SESSION_ONLY: 50 case CONTENT_SETTING_SESSION_ONLY:
51 return PermissionStatus::GRANTED; 51 return PermissionStatus::GRANTED;
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 // Add the callback to |callbacks| which will be run after the loop to 471 // Add the callback to |callbacks| which will be run after the loop to
472 // prevent re-entrance issues. 472 // prevent re-entrance issues.
473 callbacks.push_back( 473 callbacks.push_back(
474 base::Bind(subscription->callback, 474 base::Bind(subscription->callback,
475 ContentSettingToPermissionStatus(new_value))); 475 ContentSettingToPermissionStatus(new_value)));
476 } 476 }
477 477
478 for (const auto& callback : callbacks) 478 for (const auto& callback : callbacks)
479 callback.Run(); 479 callback.Run();
480 } 480 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_manager.h ('k') | chrome/browser/permissions/permission_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698