| 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 #include "chrome/browser/ui/chrome_bubble_manager.h" | 5 #include "chrome/browser/ui/chrome_bubble_manager.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "base/metrics/sparse_histogram.h" | 8 #include "base/metrics/sparse_histogram.h" |
| 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 10 #include "components/bubble/bubble_controller.h" | 10 #include "components/bubble/bubble_controller.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 } | 133 } |
| 134 | 134 |
| 135 void ChromeBubbleManager::ActiveTabChanged(content::WebContents* old_contents, | 135 void ChromeBubbleManager::ActiveTabChanged(content::WebContents* old_contents, |
| 136 content::WebContents* new_contents, | 136 content::WebContents* new_contents, |
| 137 int index, | 137 int index, |
| 138 int reason) { | 138 int reason) { |
| 139 Observe(new_contents); | 139 Observe(new_contents); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void ChromeBubbleManager::DidToggleFullscreenModeForTab( | 142 void ChromeBubbleManager::DidToggleFullscreenModeForTab( |
| 143 bool entered_fullscreen) { | 143 bool entered_fullscreen, bool will_cause_resize) { |
| 144 CloseAllBubbles(BUBBLE_CLOSE_FULLSCREEN_TOGGLED); | 144 CloseAllBubbles(BUBBLE_CLOSE_FULLSCREEN_TOGGLED); |
| 145 // Any bubble that didn't close should update its anchor position. | 145 // Any bubble that didn't close should update its anchor position. |
| 146 UpdateAllBubbleAnchors(); | 146 UpdateAllBubbleAnchors(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void ChromeBubbleManager::NavigationEntryCommitted( | 149 void ChromeBubbleManager::NavigationEntryCommitted( |
| 150 const content::LoadCommittedDetails& load_details) { | 150 const content::LoadCommittedDetails& load_details) { |
| 151 CloseAllBubbles(BUBBLE_CLOSE_NAVIGATED); | 151 CloseAllBubbles(BUBBLE_CLOSE_NAVIGATED); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void ChromeBubbleManager::ChromeBubbleMetrics::OnBubbleNeverShown( | 154 void ChromeBubbleManager::ChromeBubbleMetrics::OnBubbleNeverShown( |
| 155 BubbleReference bubble) { | 155 BubbleReference bubble) { |
| 156 UMA_HISTOGRAM_SPARSE_SLOWLY("Bubbles.NeverShown", GetBubbleId(bubble)); | 156 UMA_HISTOGRAM_SPARSE_SLOWLY("Bubbles.NeverShown", GetBubbleId(bubble)); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void ChromeBubbleManager::ChromeBubbleMetrics::OnBubbleClosed( | 159 void ChromeBubbleManager::ChromeBubbleMetrics::OnBubbleClosed( |
| 160 BubbleReference bubble, BubbleCloseReason reason) { | 160 BubbleReference bubble, BubbleCloseReason reason) { |
| 161 // Log the amount of time the bubble was visible. | 161 // Log the amount of time the bubble was visible. |
| 162 base::TimeDelta visible_time = bubble->GetVisibleTime(); | 162 base::TimeDelta visible_time = bubble->GetVisibleTime(); |
| 163 UMA_HISTOGRAM_LONG_TIMES("Bubbles.DisplayTime.All", visible_time); | 163 UMA_HISTOGRAM_LONG_TIMES("Bubbles.DisplayTime.All", visible_time); |
| 164 | 164 |
| 165 LogBubbleCloseReason(bubble, reason); | 165 LogBubbleCloseReason(bubble, reason); |
| 166 } | 166 } |
| OLD | NEW |