mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add context menu support (issue #509):
- Add new CefContextMenuHandler, CefContextMenuParams and CefMenuModel classes. - Add cef_strings.grd and related infrastructure for supporting translation of CEF strings. - Generate include/cef_pack_resources.h and include/cef_pack_strings.h files at build time that include all IDs used by CEF pack files. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@595 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -109,7 +109,6 @@ class CefValueController
|
||||
void TakeFrom(CefValueController* other);
|
||||
|
||||
private:
|
||||
|
||||
// Owner object.
|
||||
void* owner_value_;
|
||||
Object* owner_object_;
|
||||
@@ -242,9 +241,7 @@ class CefValueBase : public CefType, public CefValueController::Object {
|
||||
if (!reference() && !controller_) {
|
||||
// For owned values default to using a new multi-threaded controller.
|
||||
controller_ = new CefValueControllerThreadSafe();
|
||||
CefValueController::AutoLock lock_scope(controller_);
|
||||
if (lock_scope.verified())
|
||||
controller_->SetOwner(value_, this);
|
||||
SetOwnsController();
|
||||
}
|
||||
|
||||
// A controller is required.
|
||||
@@ -286,7 +283,7 @@ class CefValueBase : public CefType, public CefValueController::Object {
|
||||
// Remove the object from the controller. If this is the owner object any
|
||||
// references will be detached.
|
||||
controller()->Remove(value_, false);
|
||||
|
||||
|
||||
if (will_delete()) {
|
||||
// Remove any dependencies.
|
||||
controller()->RemoveDependencies(value_);
|
||||
@@ -313,7 +310,7 @@ class CefValueBase : public CefType, public CefValueController::Object {
|
||||
// They will be removed from this controller.
|
||||
new_controller->TakeFrom(controller());
|
||||
}
|
||||
|
||||
|
||||
// Remove the object from the controller. If this is the owner object any
|
||||
// references will be detached.
|
||||
controller()->Remove(value_, false);
|
||||
@@ -378,6 +375,13 @@ class CefValueBase : public CefType, public CefValueController::Object {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Used to indicate that this object owns the controller.
|
||||
inline void SetOwnsController() {
|
||||
CefValueController::AutoLock lock_scope(controller_);
|
||||
if (lock_scope.verified())
|
||||
controller_->SetOwner(value_, this);
|
||||
}
|
||||
|
||||
// Encapsulates value locking and verification logic.
|
||||
class AutoLock {
|
||||
public:
|
||||
|
Reference in New Issue
Block a user