1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_FRAME_NAVIGATION_CONSTRAINTS_H_
6 #define CHROME_FRAME_NAVIGATION_CONSTRAINTS_H_
11 #include "base/win/scoped_comptr.h"
14 // Provides an interface which controls navigation within ChromeFrame.
15 class NavigationConstraints
{
17 virtual ~NavigationConstraints() {}
18 virtual bool AllowUnsafeUrls() = 0;
19 virtual bool IsSchemeAllowed(const GURL
& url
) = 0;
20 virtual bool IsZoneAllowed(const GURL
& url
) = 0;
23 // Provides default implementation for the NavigationConstraints interface.
24 class NavigationConstraintsImpl
: public NavigationConstraints
{
26 NavigationConstraintsImpl();
27 virtual ~NavigationConstraintsImpl() {}
29 // NavigationConstraints method overrides.
30 virtual bool AllowUnsafeUrls();
31 virtual bool IsSchemeAllowed(const GURL
& url
);
32 virtual bool IsZoneAllowed(const GURL
& url
);
34 bool is_privileged() const;
35 void set_is_privileged(bool is_privileged
);
38 base::win::ScopedComPtr
<IInternetSecurityManager
> security_manager_
;
40 // The plugin is privileged if it is:
41 // * Being hosted by a custom host exposing the SID_ChromeFramePrivileged
44 // When privileged, additional interfaces are made available to the user.
48 #endif // CHROME_FRAME_NAVIGATION_CONSTRAINTS_H_