| Index: chrome/browser/tab_contents/constrained_window.h
|
| diff --git a/chrome/browser/tab_contents/constrained_window.h b/chrome/browser/tab_contents/constrained_window.h
|
| index a1b8c2abcb84cb3b3862e3b2ea28d1d3fdd5637d..a52b9ffb0ee1340f833b32f61293c25c902bd451 100644
|
| --- a/chrome/browser/tab_contents/constrained_window.h
|
| +++ b/chrome/browser/tab_contents/constrained_window.h
|
| @@ -1,10 +1,12 @@
|
| -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| #ifndef CHROME_BROWSER_TAB_CONTENTS_CONSTRAINED_WINDOW_H_
|
| #define CHROME_BROWSER_TAB_CONTENTS_CONSTRAINED_WINDOW_H_
|
|
|
| +#include <set>
|
| +
|
| #include "chrome/common/page_transition_types.h"
|
| #include "webkit/glue/window_open_disposition.h"
|
|
|
| @@ -42,6 +44,45 @@ class ConstrainedWindow {
|
|
|
| // Closes the Constrained Window.
|
| virtual void CloseConstrainedWindow() = 0;
|
| +
|
| + // Events which constrained windows may recognize.
|
| + enum Event {
|
| + kEventNavigate,
|
| + };
|
| +
|
| + // Inform the constrained the window that its parent tab will do something.
|
| + // Returns |true| if it did something in response, |false| if not. The default
|
| + // implementation, appropriate for "content-area" constrained windows, does
|
| + // the following:
|
| + // - |kEventNavigate|: calls |CloseConstrainedWindow()|;
|
| + // - anything/everything else: nothing.
|
| + // Platforms which implement non-"content-area" constrained windows (e.g.,
|
| + // tab-modal open/close dialogs) should override this.
|
| + virtual bool ParentWillDo(Event event);
|
| +
|
| + // The level of modality, in order of increasing modality (or in the
|
| + // enumeration is important):
|
| + // - kModalNone: no modality (not for use by constrained windows themselves
|
| + // -- but for others when reporting the current modality level)
|
| + // - kModalForContent: "content-modality" (toolbar, navigation, etc. remain
|
| + // enabled)
|
| + // - kModalForTab: full tab-modality (visual tab contents are all disabled)
|
| + // - kModalForWindow: window-modality (reserved)
|
| + // Things which are disabled for a given level of modality should also be
|
| + // disabled for higher levels.
|
| + // TODO(viettrungluu@gmail.com): These probably deserve a better (more
|
| + // general) home than in the constrained window stuff.
|
| + enum ModalityLevel {
|
| + kModalNone = 0,
|
| + kModalForContent,
|
| + kModalForTab,
|
| + kModalForWindow
|
| + };
|
| +
|
| + // Gets the modality level of the constrained window (which should be static,
|
| + // in that it should not vary over the lifetime of the window). The default
|
| + // implementation produces only "content-modal" constrained windows.
|
| + virtual ModalityLevel GetModalityLevel() { return kModalForContent; }
|
| };
|
|
|
| #endif // CHROME_BROWSER_TAB_CONTENTS_CONSTRAINED_WINDOW_H_
|
|
|