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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 void ChromeBubbleManager::DidToggleFullscreenModeForTab( | 154 void ChromeBubbleManager::DidToggleFullscreenModeForTab( |
155 bool entered_fullscreen, bool will_cause_resize) { | 155 bool entered_fullscreen, bool will_cause_resize) { |
156 CloseAllBubbles(BUBBLE_CLOSE_FULLSCREEN_TOGGLED); | 156 CloseAllBubbles(BUBBLE_CLOSE_FULLSCREEN_TOGGLED); |
157 // Any bubble that didn't close should update its anchor position. | 157 // Any bubble that didn't close should update its anchor position. |
158 UpdateAllBubbleAnchors(); | 158 UpdateAllBubbleAnchors(); |
159 } | 159 } |
160 | 160 |
161 void ChromeBubbleManager::NavigationEntryCommitted( | 161 void ChromeBubbleManager::NavigationEntryCommitted( |
162 const content::LoadCommittedDetails& load_details) { | 162 const content::LoadCommittedDetails& load_details) { |
163 if (!load_details.is_in_page) | 163 if (!load_details.is_same_document) |
164 CloseAllBubbles(BUBBLE_CLOSE_NAVIGATED); | 164 CloseAllBubbles(BUBBLE_CLOSE_NAVIGATED); |
165 } | 165 } |
166 | 166 |
167 void ChromeBubbleManager::ChromeBubbleMetrics::OnBubbleNeverShown( | 167 void ChromeBubbleManager::ChromeBubbleMetrics::OnBubbleNeverShown( |
168 BubbleReference bubble) { | 168 BubbleReference bubble) { |
169 UMA_HISTOGRAM_SPARSE_SLOWLY("Bubbles.NeverShown", GetBubbleId(bubble)); | 169 UMA_HISTOGRAM_SPARSE_SLOWLY("Bubbles.NeverShown", GetBubbleId(bubble)); |
170 } | 170 } |
171 | 171 |
172 void ChromeBubbleManager::ChromeBubbleMetrics::OnBubbleClosed( | 172 void ChromeBubbleManager::ChromeBubbleMetrics::OnBubbleClosed( |
173 BubbleReference bubble, BubbleCloseReason reason) { | 173 BubbleReference bubble, BubbleCloseReason reason) { |
174 // Log the amount of time the bubble was visible. | 174 // Log the amount of time the bubble was visible. |
175 base::TimeDelta visible_time = bubble->GetVisibleTime(); | 175 base::TimeDelta visible_time = bubble->GetVisibleTime(); |
176 UMA_HISTOGRAM_LONG_TIMES("Bubbles.DisplayTime.All", visible_time); | 176 UMA_HISTOGRAM_LONG_TIMES("Bubbles.DisplayTime.All", visible_time); |
177 | 177 |
178 LogBubbleCloseReason(bubble, reason); | 178 LogBubbleCloseReason(bubble, reason); |
179 } | 179 } |
OLD | NEW |