| 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 a85c3bb35b9410f55ddf07ef2ed158730a37a73c..800c45de6a720db21a754d7180886be596eb1cf6 100644
|
| --- a/chrome/browser/tab_contents/tab_contents.h
|
| +++ b/chrome/browser/tab_contents/tab_contents.h
|
| @@ -348,14 +348,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,
|
| @@ -376,18 +368,40 @@ 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.
|
| + // FIXME(viettrungluu@gmail.com): Can there ever be more than one constrained
|
| + // dialog? (On Mac and on Linux, no. Possibly yes on Windows.)
|
| + bool CanCreateConstrainedDialog() { return !child_windows_.size(); }
|
| +
|
| + // Gets the current modality level (maximum level of all constrained children;
|
| + // |kModalityNone| if no children).
|
| + ConstrainedWindow::ModalityLevel GetTabModalityLevel();
|
| +
|
| + // Returns the number of constrained windows in this tab. Used by tests.
|
| size_t constrained_window_count() { return child_windows_.size(); }
|
|
|
| + // Needed below. TODO(viettrungluu@gmail.com): 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@gmail.com): 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
|
| @@ -702,8 +716,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).
|
| @@ -786,6 +798,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.
|
| @@ -1067,6 +1083,17 @@ 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_;
|
| +
|
| + // Number of child windows requesting tab-modality; should probably never
|
| + // exceed 1.
|
| + unsigned tab_modal_count_;
|
| +
|
| // Data for find in page -----------------------------------------------------
|
|
|
| // TODO(brettw) this should be separated into a helper class.
|
|
|