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

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

Issue 1921553003: Move permission.mojom from WebKit/public/platform/ to components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn check fix 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 24 matching lines...) Expand all
35 #if !defined(OS_ANDROID) 35 #if !defined(OS_ANDROID)
36 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" 36 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
37 #endif 37 #endif
38 38
39 #if BUILDFLAG(ANDROID_JAVA_UI) 39 #if BUILDFLAG(ANDROID_JAVA_UI)
40 #include "chrome/browser/geolocation/geolocation_permission_context_android.h" 40 #include "chrome/browser/geolocation/geolocation_permission_context_android.h"
41 #else 41 #else
42 #include "chrome/browser/geolocation/geolocation_permission_context.h" 42 #include "chrome/browser/geolocation/geolocation_permission_context.h"
43 #endif 43 #endif
44 44
45 using blink::mojom::PermissionStatus; 45 using permissions::mojom::PermissionStatus;
46 using content::PermissionType; 46 using content::PermissionType;
47 47
48 namespace { 48 namespace {
49 49
50 // Helper method to convert ContentSetting to PermissionStatus. 50 // Helper method to convert ContentSetting to PermissionStatus.
51 PermissionStatus ContentSettingToPermissionStatus(ContentSetting setting) { 51 PermissionStatus ContentSettingToPermissionStatus(ContentSetting setting) {
52 switch (setting) { 52 switch (setting) {
53 case CONTENT_SETTING_ALLOW: 53 case CONTENT_SETTING_ALLOW:
54 case CONTENT_SETTING_SESSION_ONLY: 54 case CONTENT_SETTING_SESSION_ONLY:
55 return PermissionStatus::GRANTED; 55 return PermissionStatus::GRANTED;
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 // Add the callback to |callbacks| which will be run after the loop to 487 // Add the callback to |callbacks| which will be run after the loop to
488 // prevent re-entrance issues. 488 // prevent re-entrance issues.
489 callbacks.push_back( 489 callbacks.push_back(
490 base::Bind(subscription->callback, 490 base::Bind(subscription->callback,
491 ContentSettingToPermissionStatus(new_value))); 491 ContentSettingToPermissionStatus(new_value)));
492 } 492 }
493 493
494 for (const auto& callback : callbacks) 494 for (const auto& callback : callbacks)
495 callback.Run(); 495 callback.Run();
496 } 496 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698