forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chromecast] Fix broken build due to permission manager interface.
Review URL: https://codereview.chromium.org/1042493003 Cr-Commit-Position: refs/heads/master@{#322850}
- Loading branch information
gfhuang
authored and
Commit bot
committed
Mar 30, 2015
1 parent
bee8ad8
commit 7545689
Showing
7 changed files
with
120 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Copyright 2015 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chromecast/browser/cast_permission_manager.h" | ||
|
||
#include "base/callback.h" | ||
#include "content/public/browser/permission_type.h" | ||
|
||
namespace chromecast { | ||
namespace shell { | ||
|
||
CastPermissionManager::CastPermissionManager() | ||
: content::PermissionManager() { | ||
} | ||
|
||
CastPermissionManager::~CastPermissionManager() { | ||
} | ||
|
||
void CastPermissionManager::RequestPermission( | ||
content::PermissionType permission, | ||
content::WebContents* web_contents, | ||
int request_id, | ||
const GURL& origin, | ||
bool user_gesture, | ||
const base::Callback<void(content::PermissionStatus)>& callback) { | ||
LOG(INFO) << __FUNCTION__ << ": " << static_cast<int>(permission); | ||
callback.Run(content::PermissionStatus::PERMISSION_STATUS_GRANTED); | ||
} | ||
|
||
void CastPermissionManager::CancelPermissionRequest( | ||
content::PermissionType permission, | ||
content::WebContents* web_contents, | ||
int request_id, | ||
const GURL& origin) { | ||
} | ||
|
||
void CastPermissionManager::ResetPermission( | ||
content::PermissionType permission, | ||
const GURL& requesting_origin, | ||
const GURL& embedding_origin) { | ||
} | ||
|
||
content::PermissionStatus CastPermissionManager::GetPermissionStatus( | ||
content::PermissionType permission, | ||
const GURL& requesting_origin, | ||
const GURL& embedding_origin) { | ||
LOG(INFO) << __FUNCTION__ << ": " << static_cast<int>(permission); | ||
return content::PermissionStatus::PERMISSION_STATUS_GRANTED; | ||
} | ||
|
||
void CastPermissionManager::RegisterPermissionUsage( | ||
content::PermissionType permission, | ||
const GURL& requesting_origin, | ||
const GURL& embedding_origin) { | ||
} | ||
|
||
} // namespace shell | ||
} // namespace chromecast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2015 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROMECAST_BROWSER_CAST_PERMISSION_MANAGER_H_ | ||
#define CHROMECAST_BROWSER_CAST_PERMISSION_MANAGER_H_ | ||
|
||
#include "base/callback_forward.h" | ||
#include "base/macros.h" | ||
#include "content/public/browser/permission_manager.h" | ||
|
||
namespace chromecast { | ||
namespace shell { | ||
|
||
class CastPermissionManager : public content::PermissionManager { | ||
public: | ||
CastPermissionManager(); | ||
~CastPermissionManager() override; | ||
|
||
// content::PermissionManager implementation: | ||
void RequestPermission( | ||
content::PermissionType permission, | ||
content::WebContents* web_contents, | ||
int request_id, | ||
const GURL& requesting_origin, | ||
bool user_gesture, | ||
const base::Callback<void(content::PermissionStatus)>& callback) override; | ||
void CancelPermissionRequest(content::PermissionType permission, | ||
content::WebContents* web_contents, | ||
int request_id, | ||
const GURL& requesting_origin) override; | ||
void ResetPermission(content::PermissionType permission, | ||
const GURL& requesting_origin, | ||
const GURL& embedding_origin) override; | ||
content::PermissionStatus GetPermissionStatus( | ||
content::PermissionType permission, | ||
const GURL& requesting_origin, | ||
const GURL& embedding_origin) override; | ||
void RegisterPermissionUsage(content::PermissionType permission, | ||
const GURL& requesting_origin, | ||
const GURL& embedding_origin) override; | ||
|
||
private: | ||
DISALLOW_COPY_AND_ASSIGN(CastPermissionManager); | ||
}; | ||
|
||
} // namespace shell | ||
} // namespace chromecast | ||
|
||
#endif // CHROMECAST_BROWSER_CAST_PERMISSION_MANAGER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters