diff -r 000000000000 -r 6474c204b198 dom/ipc/TabContext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dom/ipc/TabContext.h Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,289 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set sw=2 ts=8 et tw=80 : */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_TabContext_h +#define mozilla_dom_TabContext_h + +#include "mozilla/layout/RenderFrameUtils.h" +#include "mozIApplication.h" +#include "nsCOMPtr.h" + +namespace mozilla { +namespace dom { + +struct IPCTabContext; + +/** + * TabContext encapsulates information about an iframe that may be a mozbrowser + * or mozapp. You can ask whether a TabContext corresponds to a mozbrowser or + * mozapp, get the app that contains the browser, and so on. + * + * TabParent and TabChild both inherit from TabContext, and you can also have + * standalone TabContext objects. + * + * This class is immutable except by calling one of the protected + * SetTabContext*() methods (and those methods can only be called once). See + * also MutableTabContext. + */ +class TabContext +{ +protected: + typedef mozilla::layout::ScrollingBehavior ScrollingBehavior; + +public: + TabContext(); + + /* (The implicit copy-constructor and operator= are fine.) */ + + /** + * Generates IPCTabContext of type BrowserFrameIPCTabContext or + * AppFrameIPCTabContext from this TabContext's information. + */ + IPCTabContext AsIPCTabContext() const; + + /** + * Does this TabContext correspond to a mozbrowser? (