Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2071)

Unified Diff: chrome/browser/tab_contents/constrained_window.h

Issue 164547: Mac: make save/open dialogs operate as tab-modal sheets.... Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Painfully (but hopefully correctly) merged ToT. Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/shell_dialogs.h ('k') | chrome/browser/tab_contents/constrained_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « chrome/browser/shell_dialogs.h ('k') | chrome/browser/tab_contents/constrained_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698