Browse Source

Updated some WebBrowserComponent documentation

tags/2021-05-28
ed 5 years ago
parent
commit
c06b9d17a5
3 changed files with 9 additions and 19 deletions
  1. +0
    -11
      modules/juce_gui_extra/juce_gui_extra.cpp
  2. +1
    -1
      modules/juce_gui_extra/juce_gui_extra.h
  3. +8
    -7
      modules/juce_gui_extra/misc/juce_WebBrowserComponent.h

+ 0
- 11
modules/juce_gui_extra/juce_gui_extra.cpp View File

@@ -184,14 +184,3 @@
#include "native/juce_android_WebBrowserComponent.cpp" #include "native/juce_android_WebBrowserComponent.cpp"
#endif #endif
#endif #endif
#if JUCE_WEB_BROWSER
namespace juce
{
bool WebBrowserComponent::pageAboutToLoad (const String&) { return true; }
void WebBrowserComponent::pageFinishedLoading (const String&) {}
bool WebBrowserComponent::pageLoadHadNetworkError (const String&) { return true; }
void WebBrowserComponent::windowCloseRequest() {}
void WebBrowserComponent::newWindowAttemptingToLoad (const String&) {}
}
#endif

+ 1
- 1
modules/juce_gui_extra/juce_gui_extra.h View File

@@ -50,7 +50,7 @@
//============================================================================== //==============================================================================
/** Config: JUCE_WEB_BROWSER /** Config: JUCE_WEB_BROWSER
This lets you disable the WebBrowserComponent class (Mac, Windows, and Linux).
This lets you disable the WebBrowserComponent class.
If you're not using any embedded web-pages, turning this off may reduce your code size. If you're not using any embedded web-pages, turning this off may reduce your code size.
*/ */
#ifndef JUCE_WEB_BROWSER #ifndef JUCE_WEB_BROWSER


+ 8
- 7
modules/juce_gui_extra/misc/juce_WebBrowserComponent.h View File

@@ -32,7 +32,7 @@ namespace juce
@tags{GUI} @tags{GUI}
*/ */
class JUCE_API WebBrowserComponent : public Component
class JUCE_API WebBrowserComponent : public Component
{ {
public: public:
//============================================================================== //==============================================================================
@@ -88,10 +88,10 @@ public:
tries to go to a particular URL. To allow the operation to carry on, tries to go to a particular URL. To allow the operation to carry on,
return true, or return false to stop the navigation happening. return true, or return false to stop the navigation happening.
*/ */
virtual bool pageAboutToLoad (const String& newURL);
virtual bool pageAboutToLoad (const String& newURL) { ignoreUnused (newURL); return true; }
/** This callback happens when the browser has finished loading a page. */ /** This callback happens when the browser has finished loading a page. */
virtual void pageFinishedLoading (const String& url);
virtual void pageFinishedLoading (const String& url) { ignoreUnused (url); }
/** This callback happens when a network error was encountered while /** This callback happens when a network error was encountered while
trying to load a page. trying to load a page.
@@ -103,18 +103,18 @@ public:
The errorInfo contains some platform dependent string describing the The errorInfo contains some platform dependent string describing the
error. error.
*/ */
virtual bool pageLoadHadNetworkError (const String& errorInfo);
virtual bool pageLoadHadNetworkError (const String& errorInfo) { ignoreUnused (errorInfo); return true; }
/** This callback occurs when a script or other activity in the browser asks for /** This callback occurs when a script or other activity in the browser asks for
the window to be closed. the window to be closed.
*/ */
virtual void windowCloseRequest();
virtual void windowCloseRequest() {}
/** This callback occurs when the browser attempts to load a URL in a new window. /** This callback occurs when the browser attempts to load a URL in a new window.
This won't actually load the window but gives you a chance to either launch a This won't actually load the window but gives you a chance to either launch a
new window yourself or just load the URL into the current window with goToURL(). new window yourself or just load the URL into the current window with goToURL().
*/ */
virtual void newWindowAttemptingToLoad (const String& newURL);
virtual void newWindowAttemptingToLoad (const String& newURL) { ignoreUnused (newURL); }
//============================================================================== //==============================================================================
/** @internal */ /** @internal */
@@ -127,8 +127,10 @@ public:
void visibilityChanged() override; void visibilityChanged() override;
/** @internal */ /** @internal */
void focusGained (FocusChangeType) override; void focusGained (FocusChangeType) override;
/** @internal */ /** @internal */
class Pimpl; class Pimpl;
private: private:
//============================================================================== //==============================================================================
std::unique_ptr<Pimpl> browser; std::unique_ptr<Pimpl> browser;
@@ -143,7 +145,6 @@ private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebBrowserComponent) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebBrowserComponent)
}; };
#endif #endif
} // namespace juce } // namespace juce

Loading…
Cancel
Save