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

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

Issue 459008: Mac: the return of the tab-modal-sheets patch. (Closed)
Patch Set: Merged ToT. Must ... commit ... soon. Created 11 years 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/tab_contents/constrained_window.cc ('k') | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.h
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index bd7460275097e02bc32aa0183fac7998e873591d..7aa7a802a3ee6a9bd41fe8350c7182d52563d342 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -346,14 +346,6 @@ class TabContents : public PageNavigator,
// Window management ---------------------------------------------------------
- // Create a new window constrained to this TabContents' clip and visibility.
- // The window is initialized by using the supplied delegate to obtain basic
- // window characteristics, and the supplied view for the content. The window
- // is sized according to the preferred size of the content_view, and centered
- // within the contents.
- ConstrainedWindow* CreateConstrainedDialog(
- ConstrainedWindowDelegate* delegate);
-
// Adds a new tab or window with the given already-created contents
void AddNewContents(TabContents* new_contents,
WindowOpenDisposition disposition,
@@ -375,18 +367,38 @@ class TabContents : public PageNavigator,
// Called when the blocked popup notification is shown or hidden.
virtual void PopupNotificationVisibilityChanged(bool visible);
- // Returns the number of constrained windows in this tab. Used by tests.
+ // Create a new window constrained to this TabContents' clip and visibility.
+ // The window is initialized by using the supplied delegate to obtain basic
+ // window characteristics, and the supplied view for the content. On Windows
+ // and Linux, the window is sized according to the preferred size of the
+ // content_view and centered within the contents; on Mac, it is attached as a
+ // panel at the top of the tab contents area.
+ ConstrainedWindow* CreateConstrainedDialog(
+ ConstrainedWindowDelegate* delegate);
+
+ // Determines if a constrained dialog can be created.
+ // TODO(viettrungluu): Can there ever be more than one constrained dialog? (On
+ // Mac and on Linux, no. Possibly yes on Windows.)
+ bool CanCreateConstrainedDialog() { return !constrained_window_count(); }
+
+ // Returns the number of constrained windows in this tab. Used by tests and
+ // internally.
size_t constrained_window_count() { return child_windows_.size(); }
+ // Needed below.
+ // TODO(viettrungluu): Make this private.
typedef std::vector<ConstrainedWindow*> ConstrainedWindowList;
- // Return an iterator for the first constrained window in this tab contents.
+ // Return iterators for the first and past-the-last constrained window in this
+ // tab contents.
+ // TODO(viettrungluu): Remove these or at least make them private. These are
+ // currently only used by (the Objective-C, Mac class) |TabStripController|
+ // (in cocoa/tab_strip_controller.mm). There must be a cleaner way to provide
+ // this functionality. Please resist using these.
ConstrainedWindowList::iterator constrained_window_begin()
- { return child_windows_.begin(); }
-
- // Return an iterator for the last constrained window in this tab contents.
+ { return child_windows_.begin(); }
ConstrainedWindowList::iterator constrained_window_end()
- { return child_windows_.end(); }
+ { return child_windows_.end(); }
// Views and focus -----------------------------------------------------------
// TODO(brettw): Most of these should be removed and the caller should call
@@ -714,8 +726,6 @@ class TabContents : public PageNavigator,
// up at the next animation step if the throbber is going.
void SetNotWaitingForResponse() { waiting_for_response_ = false; }
- ConstrainedWindowList child_windows_;
-
// Expires InfoBars that need to be expired, according to the state carried
// in |details|, in response to a new NavigationEntry being committed (the
// user navigated to another page).
@@ -792,6 +802,10 @@ class TabContents : public PageNavigator,
void GenerateKeywordIfNecessary(
const ViewHostMsg_FrameNavigate_Params& params);
+ // Used to notify child constrained windows that something will take place
+ // (e.g., navigation).
+ void NotifyChildrenOfPendingEvent(ConstrainedWindow::Event event);
+
// RenderViewHostDelegate ----------------------------------------------------
// RenderViewHostDelegate::BrowserIntegration implementation.
@@ -1076,6 +1090,13 @@ class TabContents : public PageNavigator,
// Delegates for InfoBars associated with this TabContents.
std::vector<InfoBarDelegate*> infobar_delegates_;
+ // Data for constrained windows ----------------------------------------------
+
+ // List of constrained windows. Note: Currently, Mac and Linux only support a
+ // single constrained child window; conceivably, this could change in the
+ // future.
+ ConstrainedWindowList child_windows_;
+
// Data for find in page -----------------------------------------------------
// TODO(brettw) this should be separated into a helper class.
« no previous file with comments | « chrome/browser/tab_contents/constrained_window.cc ('k') | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698