| 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 <deque> |
| 10 #include <map> | 11 #include <map> |
| 11 #include <set> | 12 #include <set> |
| 12 #include <string> | 13 #include <string> |
| 13 #include <vector> | 14 #include <vector> |
| 14 | 15 |
| 15 #include "app/gfx/native_widget_types.h" | 16 #include "app/gfx/native_widget_types.h" |
| 16 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
| 17 #include "base/gfx/rect.h" | 18 #include "base/gfx/rect.h" |
| 18 #include "base/scoped_ptr.h" | 19 #include "base/scoped_ptr.h" |
| 19 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 20 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 337 |
| 337 // Shows the page info. | 338 // Shows the page info. |
| 338 void ShowPageInfo(const GURL& url, | 339 void ShowPageInfo(const GURL& url, |
| 339 const NavigationEntry::SSLStatus& ssl, | 340 const NavigationEntry::SSLStatus& ssl, |
| 340 bool show_history); | 341 bool show_history); |
| 341 | 342 |
| 342 // Window management --------------------------------------------------------- | 343 // Window management --------------------------------------------------------- |
| 343 | 344 |
| 344 // Create a new window constrained to this TabContents' clip and visibility. | 345 // Create a new window constrained to this TabContents' clip and visibility. |
| 345 // The window is initialized by using the supplied delegate to obtain basic | 346 // The window is initialized by using the supplied delegate to obtain basic |
| 346 // window characteristics, and the supplied view for the content. The window | 347 // window characteristics, and the supplied view for the content. Note that |
| 347 // is sized according to the preferred size of the content_view, and centered | 348 // the returned ConstrainedWindow might not yet be visible. |
| 348 // within the contents. | |
| 349 ConstrainedWindow* CreateConstrainedDialog( | 349 ConstrainedWindow* CreateConstrainedDialog( |
| 350 ConstrainedWindowDelegate* delegate); | 350 ConstrainedWindowDelegate* delegate); |
| 351 | 351 |
| 352 // Adds a new tab or window with the given already-created contents | 352 // Adds a new tab or window with the given already-created contents |
| 353 void AddNewContents(TabContents* new_contents, | 353 void AddNewContents(TabContents* new_contents, |
| 354 WindowOpenDisposition disposition, | 354 WindowOpenDisposition disposition, |
| 355 const gfx::Rect& initial_pos, | 355 const gfx::Rect& initial_pos, |
| 356 bool user_gesture, | 356 bool user_gesture, |
| 357 const GURL& creator_url); | 357 const GURL& creator_url); |
| 358 | 358 |
| 359 // Closes all constrained windows that represent web popups that have not yet | 359 // Closes all constrained windows that represent web popups that have not yet |
| 360 // been activated by the user and are as such auto-positioned in the bottom | 360 // been activated by the user and are as such auto-positioned in the bottom |
| 361 // right of the screen. This is a quick way for users to "clean up" a flurry | 361 // right of the screen. This is a quick way for users to "clean up" a flurry |
| 362 // of unwanted popups. | 362 // of unwanted popups. |
| 363 void CloseAllSuppressedPopups(); | 363 void CloseAllSuppressedPopups(); |
| 364 | 364 |
| 365 // Execute code in this tab. | 365 // Execute code in this tab. |
| 366 void ExecuteCode(int request_id, const std::string& extension_id, | 366 void ExecuteCode(int request_id, const std::string& extension_id, |
| 367 bool is_js_code, const std::string& code_string); | 367 bool is_js_code, const std::string& code_string); |
| 368 | 368 |
| 369 // Called when the blocked popup notification is shown or hidden. | 369 // Called when the blocked popup notification is shown or hidden. |
| 370 virtual void PopupNotificationVisibilityChanged(bool visible); | 370 virtual void PopupNotificationVisibilityChanged(bool visible); |
| 371 | 371 |
| 372 // Returns the number of constrained windows in this tab. Used by tests. | 372 // Returns the number of constrained windows in this tab. Used by tests. |
| 373 size_t constrained_window_count() { return child_windows_.size(); } | 373 size_t constrained_window_count() { return child_windows_.size(); } |
| 374 | 374 |
| 375 typedef std::vector<ConstrainedWindow*> ConstrainedWindowList; | 375 typedef std::deque<ConstrainedWindow*> ConstrainedWindowList; |
| 376 | 376 |
| 377 // Return an iterator for the first constrained window in this tab contents. | 377 // Return an iterator for the first constrained window in this tab contents. |
| 378 ConstrainedWindowList::iterator constrained_window_begin() | 378 ConstrainedWindowList::iterator constrained_window_begin() |
| 379 { return child_windows_.begin(); } | 379 { return child_windows_.begin(); } |
| 380 | 380 |
| 381 // Return an iterator for the last constrained window in this tab contents. | 381 // Return an iterator for the last constrained window in this tab contents. |
| 382 ConstrainedWindowList::iterator constrained_window_end() | 382 ConstrainedWindowList::iterator constrained_window_end() |
| 383 { return child_windows_.end(); } | 383 { return child_windows_.end(); } |
| 384 | 384 |
| 385 // Views and focus ----------------------------------------------------------- | 385 // Views and focus ----------------------------------------------------------- |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1178 | 1178 |
| 1179 // The time that we started to close the tab. | 1179 // The time that we started to close the tab. |
| 1180 base::TimeTicks tab_close_start_time_; | 1180 base::TimeTicks tab_close_start_time_; |
| 1181 | 1181 |
| 1182 // --------------------------------------------------------------------------- | 1182 // --------------------------------------------------------------------------- |
| 1183 | 1183 |
| 1184 DISALLOW_COPY_AND_ASSIGN(TabContents); | 1184 DISALLOW_COPY_AND_ASSIGN(TabContents); |
| 1185 }; | 1185 }; |
| 1186 | 1186 |
| 1187 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 1187 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
| OLD | NEW |