| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 // Tell Gears to create a shortcut for the current page. | 330 // Tell Gears to create a shortcut for the current page. |
| 331 void CreateShortcut(); | 331 void CreateShortcut(); |
| 332 | 332 |
| 333 // Shows the page info. | 333 // Shows the page info. |
| 334 void ShowPageInfo(const GURL& url, | 334 void ShowPageInfo(const GURL& url, |
| 335 const NavigationEntry::SSLStatus& ssl, | 335 const NavigationEntry::SSLStatus& ssl, |
| 336 bool show_history); | 336 bool show_history); |
| 337 | 337 |
| 338 // Window management --------------------------------------------------------- | 338 // Window management --------------------------------------------------------- |
| 339 | 339 |
| 340 #if defined(OS_WIN) || defined(OS_LINUX) | |
| 341 // Create a new window constrained to this TabContents' clip and visibility. | 340 // Create a new window constrained to this TabContents' clip and visibility. |
| 342 // The window is initialized by using the supplied delegate to obtain basic | 341 // The window is initialized by using the supplied delegate to obtain basic |
| 343 // window characteristics, and the supplied view for the content. The window | 342 // window characteristics, and the supplied view for the content. The window |
| 344 // is sized according to the preferred size of the content_view, and centered | 343 // is sized according to the preferred size of the content_view, and centered |
| 345 // within the contents. | 344 // within the contents. |
| 346 ConstrainedWindow* CreateConstrainedDialog( | 345 ConstrainedWindow* CreateConstrainedDialog( |
| 347 ConstrainedWindowDelegate* delegate); | 346 ConstrainedWindowDelegate* delegate); |
| 348 #endif | |
| 349 | 347 |
| 350 // Adds a new tab or window with the given already-created contents | 348 // Adds a new tab or window with the given already-created contents |
| 351 void AddNewContents(TabContents* new_contents, | 349 void AddNewContents(TabContents* new_contents, |
| 352 WindowOpenDisposition disposition, | 350 WindowOpenDisposition disposition, |
| 353 const gfx::Rect& initial_pos, | 351 const gfx::Rect& initial_pos, |
| 354 bool user_gesture, | 352 bool user_gesture, |
| 355 const GURL& creator_url); | 353 const GURL& creator_url); |
| 356 | 354 |
| 357 // Closes all constrained windows that represent web popups that have not yet | 355 // Closes all constrained windows that represent web popups that have not yet |
| 358 // been activated by the user and are as such auto-positioned in the bottom | 356 // been activated by the user and are as such auto-positioned in the bottom |
| 359 // right of the screen. This is a quick way for users to "clean up" a flurry | 357 // right of the screen. This is a quick way for users to "clean up" a flurry |
| 360 // of unwanted popups. | 358 // of unwanted popups. |
| 361 void CloseAllSuppressedPopups(); | 359 void CloseAllSuppressedPopups(); |
| 362 | 360 |
| 363 // Called when the blocked popup notification is shown or hidden. | 361 // Called when the blocked popup notification is shown or hidden. |
| 364 virtual void PopupNotificationVisibilityChanged(bool visible); | 362 virtual void PopupNotificationVisibilityChanged(bool visible); |
| 365 | 363 |
| 366 // Returns the number of constrained windows in this tab. Used by tests. | 364 // Returns the number of constrained windows in this tab. Used by tests. |
| 367 size_t constrained_window_count() { return child_windows_.size(); } | 365 size_t constrained_window_count() { return child_windows_.size(); } |
| 368 | 366 |
| 367 typedef std::vector<ConstrainedWindow*> ConstrainedWindowList; |
| 368 |
| 369 // Return an iterator for the first constrained window in this tab contents. |
| 370 ConstrainedWindowList::iterator constrained_window_begin() |
| 371 { return child_windows_.begin(); } |
| 372 |
| 373 // Return an iterator for the last constrained window in this tab contents. |
| 374 ConstrainedWindowList::iterator constrained_window_end() |
| 375 { return child_windows_.end(); } |
| 376 |
| 369 // Views and focus ----------------------------------------------------------- | 377 // Views and focus ----------------------------------------------------------- |
| 370 // TODO(brettw): Most of these should be removed and the caller should call | 378 // TODO(brettw): Most of these should be removed and the caller should call |
| 371 // the view directly. | 379 // the view directly. |
| 372 | 380 |
| 373 // Returns the actual window that is focused when this TabContents is shown. | 381 // Returns the actual window that is focused when this TabContents is shown. |
| 374 gfx::NativeView GetContentNativeView(); | 382 gfx::NativeView GetContentNativeView(); |
| 375 | 383 |
| 376 // Returns the NativeView associated with this TabContents. Outside of | 384 // Returns the NativeView associated with this TabContents. Outside of |
| 377 // automation in the context of the UI, this is required to be implemented. | 385 // automation in the context of the UI, this is required to be implemented. |
| 378 gfx::NativeView GetNativeView() const; | 386 gfx::NativeView GetNativeView() const; |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 void set_blocked_popup_container(BlockedPopupContainer* container) { | 661 void set_blocked_popup_container(BlockedPopupContainer* container) { |
| 654 DCHECK(blocked_popups_ == NULL); | 662 DCHECK(blocked_popups_ == NULL); |
| 655 blocked_popups_ = container; | 663 blocked_popups_ = container; |
| 656 } | 664 } |
| 657 | 665 |
| 658 // Called by derived classes to indicate that we're no longer waiting for a | 666 // Called by derived classes to indicate that we're no longer waiting for a |
| 659 // response. This won't actually update the throbber, but it will get picked | 667 // response. This won't actually update the throbber, but it will get picked |
| 660 // up at the next animation step if the throbber is going. | 668 // up at the next animation step if the throbber is going. |
| 661 void SetNotWaitingForResponse() { waiting_for_response_ = false; } | 669 void SetNotWaitingForResponse() { waiting_for_response_ = false; } |
| 662 | 670 |
| 663 typedef std::vector<ConstrainedWindow*> ConstrainedWindowList; | |
| 664 ConstrainedWindowList child_windows_; | 671 ConstrainedWindowList child_windows_; |
| 665 | 672 |
| 666 // Expires InfoBars that need to be expired, according to the state carried | 673 // Expires InfoBars that need to be expired, according to the state carried |
| 667 // in |details|, in response to a new NavigationEntry being committed (the | 674 // in |details|, in response to a new NavigationEntry being committed (the |
| 668 // user navigated to another page). | 675 // user navigated to another page). |
| 669 void ExpireInfoBars( | 676 void ExpireInfoBars( |
| 670 const NavigationController::LoadCommittedDetails& details); | 677 const NavigationController::LoadCommittedDetails& details); |
| 671 | 678 |
| 672 // Called when the user dismisses the shortcut creation dialog. 'success' is | 679 // Called when the user dismisses the shortcut creation dialog. 'success' is |
| 673 // true if the shortcut was created. | 680 // true if the shortcut was created. |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 | 1107 |
| 1101 // Settings that get passed to the renderer process. | 1108 // Settings that get passed to the renderer process. |
| 1102 RendererPreferences renderer_preferences_; | 1109 RendererPreferences renderer_preferences_; |
| 1103 | 1110 |
| 1104 // --------------------------------------------------------------------------- | 1111 // --------------------------------------------------------------------------- |
| 1105 | 1112 |
| 1106 DISALLOW_COPY_AND_ASSIGN(TabContents); | 1113 DISALLOW_COPY_AND_ASSIGN(TabContents); |
| 1107 }; | 1114 }; |
| 1108 | 1115 |
| 1109 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 1116 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
| OLD | NEW |