OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_BROWSER_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_H_ |
6 #define CHROME_BROWSER_UI_BROWSER_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 // Overridden from TabStripModelObserver: | 430 // Overridden from TabStripModelObserver: |
431 virtual void TabInsertedAt(content::WebContents* contents, | 431 virtual void TabInsertedAt(content::WebContents* contents, |
432 int index, | 432 int index, |
433 bool foreground) OVERRIDE; | 433 bool foreground) OVERRIDE; |
434 virtual void TabClosingAt(TabStripModel* tab_strip_model, | 434 virtual void TabClosingAt(TabStripModel* tab_strip_model, |
435 content::WebContents* contents, | 435 content::WebContents* contents, |
436 int index) OVERRIDE; | 436 int index) OVERRIDE; |
437 virtual void TabDetachedAt(content::WebContents* contents, | 437 virtual void TabDetachedAt(content::WebContents* contents, |
438 int index) OVERRIDE; | 438 int index) OVERRIDE; |
439 virtual void TabDeactivated(content::WebContents* contents) OVERRIDE; | 439 virtual void TabDeactivated(content::WebContents* contents) OVERRIDE; |
440 virtual void ActiveTabChanged(content::WebContents* old_contents, | 440 // We don't override ActiveTabChanged(); instead we expect a platform-specific |
441 content::WebContents* new_contents, | 441 // TabStripModelObserver to call OnActiveTabChanged(). This allows the |
442 int index, | 442 // platform-specific handler to run first, which is important on views; see |
443 int reason) OVERRIDE; | 443 // comments at the end of BrowserView::ActiveTabChanged(). |
444 virtual void TabMoved(content::WebContents* contents, | 444 virtual void TabMoved(content::WebContents* contents, |
445 int from_index, | 445 int from_index, |
446 int to_index) OVERRIDE; | 446 int to_index) OVERRIDE; |
447 virtual void TabReplacedAt(TabStripModel* tab_strip_model, | 447 virtual void TabReplacedAt(TabStripModel* tab_strip_model, |
448 content::WebContents* old_contents, | 448 content::WebContents* old_contents, |
449 content::WebContents* new_contents, | 449 content::WebContents* new_contents, |
450 int index) OVERRIDE; | 450 int index) OVERRIDE; |
451 virtual void TabPinnedStateChanged(content::WebContents* contents, | 451 virtual void TabPinnedStateChanged(content::WebContents* contents, |
452 int index) OVERRIDE; | 452 int index) OVERRIDE; |
453 virtual void TabStripEmpty() OVERRIDE; | 453 virtual void TabStripEmpty() OVERRIDE; |
454 | 454 |
| 455 // This is the replacement for ActiveTabChanged() (see above). |
| 456 void OnActiveTabChanged(content::WebContents* old_contents, |
| 457 content::WebContents* new_contents, |
| 458 int index, |
| 459 int reason); |
| 460 |
455 // Overridden from content::WebContentsDelegate: | 461 // Overridden from content::WebContentsDelegate: |
456 virtual bool CanOverscrollContent() const OVERRIDE; | 462 virtual bool CanOverscrollContent() const OVERRIDE; |
457 virtual bool PreHandleKeyboardEvent( | 463 virtual bool PreHandleKeyboardEvent( |
458 content::WebContents* source, | 464 content::WebContents* source, |
459 const content::NativeWebKeyboardEvent& event, | 465 const content::NativeWebKeyboardEvent& event, |
460 bool* is_keyboard_shortcut) OVERRIDE; | 466 bool* is_keyboard_shortcut) OVERRIDE; |
461 virtual void HandleKeyboardEvent( | 467 virtual void HandleKeyboardEvent( |
462 content::WebContents* source, | 468 content::WebContents* source, |
463 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 469 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
464 virtual void OverscrollUpdate(int delta_y) OVERRIDE; | 470 virtual void OverscrollUpdate(int delta_y) OVERRIDE; |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 | 941 |
936 scoped_ptr<chrome::BrowserCommandController> command_controller_; | 942 scoped_ptr<chrome::BrowserCommandController> command_controller_; |
937 | 943 |
938 // True if the browser window has been shown at least once. | 944 // True if the browser window has been shown at least once. |
939 bool window_has_shown_; | 945 bool window_has_shown_; |
940 | 946 |
941 DISALLOW_COPY_AND_ASSIGN(Browser); | 947 DISALLOW_COPY_AND_ASSIGN(Browser); |
942 }; | 948 }; |
943 | 949 |
944 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 950 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
OLD | NEW |