| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/chrome_bubble_manager.h" |
| 6 |
| 7 #include "content/public/browser/browser_thread.h" |
| 8 |
| 9 ChromeBubbleManager::ChromeBubbleManager() {} |
| 10 |
| 11 ChromeBubbleManager::~ChromeBubbleManager() {} |
| 12 |
| 13 void ChromeBubbleManager::FullscreenToggle() { |
| 14 CloseAllBubbles(BUBBLE_CLOSE_FULLSCREEN); |
| 15 // Any bubble that didn't close should update its anchor position. |
| 16 UpdateAllBubbleAnchors(); |
| 17 } |
| 18 |
| 19 void ChromeBubbleManager::TabBlur() { |
| 20 CloseAllBubbles(BUBBLE_CLOSE_TABSWITCH); |
| 21 } |
| 22 |
| 23 void ChromeBubbleManager::TabFocus() { |
| 24 // TODO(hcarmona): What should bubbles do, if anything? |
| 25 } |
| 26 |
| 27 void ChromeBubbleManager::TabDetached() { |
| 28 CloseAllBubbles(BUBBLE_CLOSE_TABDETACHED); |
| 29 // Any bubble that didn't close should update its anchor position. |
| 30 UpdateAllBubbleAnchors(); |
| 31 } |
| 32 |
| 33 void ChromeBubbleManager::NavigationEntryCommitted() { |
| 34 CloseAllBubbles(BUBBLE_CLOSE_NAVIGATION); |
| 35 } |
| 36 |
| 37 void ChromeBubbleManager::ShowBubbleUI( |
| 38 base::WeakPtr<BubbleController> controller) { |
| 39 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 40 BubbleManager::ShowBubbleUI(controller); |
| 41 } |
| 42 |
| 43 bool ChromeBubbleManager::ShouldClose( |
| 44 base::WeakPtr<BubbleController> controller, |
| 45 BubbleCloseReason reason) { |
| 46 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 47 return BubbleManager::ShouldClose(controller, reason); |
| 48 } |
| 49 |
| 50 void ChromeBubbleManager::UpdateAnchorPosition( |
| 51 base::WeakPtr<BubbleController> controller) { |
| 52 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 53 BubbleManager::UpdateAnchorPosition(controller); |
| 54 } |
| OLD | NEW |