| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CHROME_BUBBLE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_UI_CHROME_BUBBLE_MANAGER_H_ |
| 6 #define CHROME_BROWSER_UI_CHROME_BUBBLE_MANAGER_H_ | 6 #define CHROME_BROWSER_UI_CHROME_BUBBLE_MANAGER_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 8 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 9 #include "components/bubble/bubble_manager.h" | 9 #include "components/bubble/bubble_manager.h" |
| 10 #include "content/public/browser/web_contents_observer.h" | 10 #include "content/public/browser/web_contents_observer.h" |
| 11 | 11 |
| 12 class TabStripModel; | 12 class TabStripModel; |
| 13 | 13 |
| 14 class ChromeBubbleManager : public BubbleManager, | 14 class ChromeBubbleManager : public BubbleManager, |
| 15 public TabStripModelObserver, | 15 public TabStripModelObserver, |
| 16 public content::WebContentsObserver { | 16 public content::WebContentsObserver { |
| 17 public: | 17 public: |
| 18 explicit ChromeBubbleManager(TabStripModel* tab_strip_model); | 18 explicit ChromeBubbleManager(TabStripModel* tab_strip_model); |
| 19 ~ChromeBubbleManager() override; | 19 ~ChromeBubbleManager() override; |
| 20 | 20 |
| 21 // TabStripModelObserver: | 21 // TabStripModelObserver: |
| 22 void TabDetachedAt(content::WebContents* contents, int index) override; | 22 void TabDetachedAt(content::WebContents* contents, int index) override; |
| 23 void TabDeactivated(content::WebContents* contents) override; | 23 void TabDeactivated(content::WebContents* contents) override; |
| 24 void ActiveTabChanged(content::WebContents* old_contents, | 24 void ActiveTabChanged(content::WebContents* old_contents, |
| 25 content::WebContents* new_contents, | 25 content::WebContents* new_contents, |
| 26 int index, | 26 int index, |
| 27 int reason) override; | 27 int reason) override; |
| 28 | 28 |
| 29 // content::WebContentsObserver: | 29 // content::WebContentsObserver: |
| 30 void DidToggleFullscreenModeForTab(bool entered_fullscreen) override; | 30 void DidToggleFullscreenModeForTab(bool entered_fullscreen, |
| 31 bool will_cause_resize) override; |
| 31 void NavigationEntryCommitted( | 32 void NavigationEntryCommitted( |
| 32 const content::LoadCommittedDetails& load_details) override; | 33 const content::LoadCommittedDetails& load_details) override; |
| 33 | 34 |
| 34 private: | 35 private: |
| 35 class ChromeBubbleMetrics : public BubbleManager::BubbleManagerObserver { | 36 class ChromeBubbleMetrics : public BubbleManager::BubbleManagerObserver { |
| 36 public: | 37 public: |
| 37 ChromeBubbleMetrics() {} | 38 ChromeBubbleMetrics() {} |
| 38 ~ChromeBubbleMetrics() override {} | 39 ~ChromeBubbleMetrics() override {} |
| 39 | 40 |
| 40 // BubbleManager::BubbleManagerObserver: | 41 // BubbleManager::BubbleManagerObserver: |
| 41 void OnBubbleNeverShown(BubbleReference bubble) override; | 42 void OnBubbleNeverShown(BubbleReference bubble) override; |
| 42 void OnBubbleClosed(BubbleReference bubble, | 43 void OnBubbleClosed(BubbleReference bubble, |
| 43 BubbleCloseReason reason) override; | 44 BubbleCloseReason reason) override; |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(ChromeBubbleMetrics); | 47 DISALLOW_COPY_AND_ASSIGN(ChromeBubbleMetrics); |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 TabStripModel* tab_strip_model_; | 50 TabStripModel* tab_strip_model_; |
| 50 ChromeBubbleMetrics chrome_bubble_metrics_; | 51 ChromeBubbleMetrics chrome_bubble_metrics_; |
| 51 | 52 |
| 52 DISALLOW_COPY_AND_ASSIGN(ChromeBubbleManager); | 53 DISALLOW_COPY_AND_ASSIGN(ChromeBubbleManager); |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 #endif // CHROME_BROWSER_UI_CHROME_BUBBLE_MANAGER_H_ | 56 #endif // CHROME_BROWSER_UI_CHROME_BUBBLE_MANAGER_H_ |
| OLD | NEW |