Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / widget / nsBaseColorPicker.h
blob3c02ba9006f77e14fa3f398dac85035519a9552e
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsBaseColorPicker_h_
7 #define nsBaseColorPicker_h_
9 #include "nsCOMPtr.h"
10 #include "nsIColorPicker.h"
11 #include "nsString.h"
13 class mozIDOMWindowProxy;
15 namespace mozilla::dom {
16 class BrowsingContext;
17 } // namespace mozilla::dom
19 class nsBaseColorPicker : public nsIColorPicker {
20 public:
21 // nsIColorPicker
22 NS_IMETHOD Init(mozilla::dom::BrowsingContext* aBrowsingContext,
23 const nsAString& aTitle, const nsAString& aInitialColor,
24 const nsTArray<nsString>& aDefaultColors) override final;
25 NS_IMETHOD Open(nsIColorPickerShownCallback* aCallback) override final;
27 protected:
28 virtual ~nsBaseColorPicker() = default;
30 virtual nsresult InitNative(const nsTArray<nsString>& aDefaultColors) = 0;
31 virtual nsresult OpenNative() = 0;
33 bool MaybeBlockColorPicker(nsIColorPickerShownCallback* aCallback);
35 RefPtr<mozilla::dom::BrowsingContext> mBrowsingContext;
36 nsString mTitle;
37 nsString mInitialColor;
38 nsCOMPtr<nsIColorPickerShownCallback> mCallback;
41 #endif // nsBaseColorPicker_h_