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

Side by Side Diff: chrome/browser/tab_contents/tab_contents.h

Issue 28156: Fix focus bug on session restore (take 2) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sessions/session_restore.cc ('k') | chrome/common/temp_scaffolding_stubs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <string> 10 #include <string>
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 // currently called by NavigationController::DiscardPendingEntry. We may 439 // currently called by NavigationController::DiscardPendingEntry. We may
440 // want to generalize this if we need to migrate some other state. 440 // want to generalize this if we need to migrate some other state.
441 static void MigrateShelfView(TabContents* from, TabContents* to); 441 static void MigrateShelfView(TabContents* from, TabContents* to);
442 442
443 // Called when a ConstrainedWindow we own is about to be closed. 443 // Called when a ConstrainedWindow we own is about to be closed.
444 void WillClose(ConstrainedWindow* window); 444 void WillClose(ConstrainedWindow* window);
445 445
446 // Called when a ConstrainedWindow we own is moved or resized. 446 // Called when a ConstrainedWindow we own is moved or resized.
447 void DidMoveOrResize(ConstrainedWindow* window); 447 void DidMoveOrResize(ConstrainedWindow* window);
448 448
449 // Sets focus to the tab contents window, but doesn't actually set focus to
450 // a particular element in it (see also SetInitialFocus(bool) which does
451 // that in different circumstances).
452 // FIXME(brettw) having two SetInitialFocus that do different things is silly.
453 virtual void SetInitialFocus();
454
449 protected: 455 protected:
450 // NotificationObserver implementation: 456 // NotificationObserver implementation:
451 virtual void Observe(NotificationType type, 457 virtual void Observe(NotificationType type,
452 const NotificationSource& source, 458 const NotificationSource& source,
453 const NotificationDetails& details); 459 const NotificationDetails& details);
454 460
455 friend class NavigationController; 461 friend class NavigationController;
456 // Used to access the child_windows_ (ConstrainedWindowList) for testing 462 // Used to access the child_windows_ (ConstrainedWindowList) for testing
457 // automation purposes. 463 // automation purposes.
458 friend class AutomationProvider; 464 friend class AutomationProvider;
459 465
460 explicit TabContents(TabContentsType type); 466 explicit TabContents(TabContentsType type);
461 467
462 // Some tab contents types need to override the type. 468 // Some tab contents types need to override the type.
463 void set_type(TabContentsType type) { type_ = type; } 469 void set_type(TabContentsType type) { type_ = type; }
464 470
465 // NOTE: the TabContents destructor can run after the NavigationController 471 // NOTE: the TabContents destructor can run after the NavigationController
466 // has gone away, so any complicated unregistering that expects the profile 472 // has gone away, so any complicated unregistering that expects the profile
467 // or other shared objects to still be around does not belong in a 473 // or other shared objects to still be around does not belong in a
468 // destructor. 474 // destructor.
469 // For those purposes, instead see Destroy(). 475 // For those purposes, instead see Destroy().
470 // Protected so that others don't try to delete this directly. 476 // Protected so that others don't try to delete this directly.
471 virtual ~TabContents(); 477 virtual ~TabContents();
472 478
473 // Sets focus to the tab contents window, but doesn't actuall set focus to
474 // a particular element in it (see also SetInitialFocus(bool) which does
475 // that in different circumstances).
476 // FIXME(brettw) having two SetInitialFocus that do different things is silly.
477 virtual void SetInitialFocus();
478
479 // Changes the IsLoading state and notifies delegate as needed 479 // Changes the IsLoading state and notifies delegate as needed
480 // |details| is used to provide details on the load that just finished 480 // |details| is used to provide details on the load that just finished
481 // (but can be null if not applicable). Can be overridden. 481 // (but can be null if not applicable). Can be overridden.
482 virtual void SetIsLoading(bool is_loading, LoadNotificationDetails* details); 482 virtual void SetIsLoading(bool is_loading, LoadNotificationDetails* details);
483 483
484 // Called by a derived class when the TabContents is resized, causing 484 // Called by a derived class when the TabContents is resized, causing
485 // suppressed constrained web popups to be repositioned to the new bounds 485 // suppressed constrained web popups to be repositioned to the new bounds
486 // if necessary. 486 // if necessary.
487 void RepositionSupressedPopupsToFit(const gfx::Size& new_size); 487 void RepositionSupressedPopupsToFit(const gfx::Size& new_size);
488 488
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 // Delegates for InfoBars associated with this TabContents. 558 // Delegates for InfoBars associated with this TabContents.
559 std::vector<InfoBarDelegate*> infobar_delegates_; 559 std::vector<InfoBarDelegate*> infobar_delegates_;
560 560
561 // See getter above. 561 // See getter above.
562 bool is_being_destroyed_; 562 bool is_being_destroyed_;
563 563
564 DISALLOW_COPY_AND_ASSIGN(TabContents); 564 DISALLOW_COPY_AND_ASSIGN(TabContents);
565 }; 565 };
566 566
567 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ 567 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_restore.cc ('k') | chrome/common/temp_scaffolding_stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698