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"
#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
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.
*/
#ifndef JUCE_WEB_BROWSER


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

@@ -32,7 +32,7 @@ namespace juce
@tags{GUI}
*/
class JUCE_API WebBrowserComponent : public Component
class JUCE_API WebBrowserComponent : public Component
{
public:
//==============================================================================
@@ -88,10 +88,10 @@ public:
tries to go to a particular URL. To allow the operation to carry on,
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. */
virtual void pageFinishedLoading (const String& url);
virtual void pageFinishedLoading (const String& url) { ignoreUnused (url); }
/** This callback happens when a network error was encountered while
trying to load a page.
@@ -103,18 +103,18 @@ public:
The errorInfo contains some platform dependent string describing the
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
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 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().
*/
virtual void newWindowAttemptingToLoad (const String& newURL);
virtual void newWindowAttemptingToLoad (const String& newURL) { ignoreUnused (newURL); }
//==============================================================================
/** @internal */
@@ -127,8 +127,10 @@ public:
void visibilityChanged() override;
/** @internal */
void focusGained (FocusChangeType) override;
/** @internal */
class Pimpl;
private:
//==============================================================================
std::unique_ptr<Pimpl> browser;
@@ -143,7 +145,6 @@ private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebBrowserComponent)
};
#endif
} // namespace juce

Loading…
Cancel
Save