Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Side by Side Diff: chrome/browser/ui/chrome_bubble_manager.cc

Issue 1251633002: Add BubbleManager to manage bubbles and ChromeBubbleManager for events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 "chrome/browser/ui/chrome_web_contents_observer.h"
8 #include "content/public/browser/web_contents.h"
9
10 ChromeBubbleManager::ChromeBubbleManager() {}
11
12 ChromeBubbleManager::~ChromeBubbleManager() {}
13
14 void ChromeBubbleManager::ListenToWebContents(
15 content::WebContents* web_contents) {
16 ChromeWebContentsObserver::CreateForWebContents(web_contents);
17 ChromeWebContentsObserver::FromWebContents(web_contents)
18 ->SetBubbleManager(this);
19 }
20
21 void ChromeBubbleManager::FullscreenToggle(content::WebContents* context) {
22 UpdateMatchingBubbles(context);
23 }
24
25 void ChromeBubbleManager::TabBlur(content::WebContents* context) {
26 HideMatchingBubbles(context, BUBBLE_CLOSE_TABSWITCH);
27 }
28
29 void ChromeBubbleManager::TabFocus(content::WebContents* context) {
30 // TODO(hcarmona): Figure out when bubbles should be re-shown.
31 // ShowMatchingBubbles(context);
please use gerrit instead 2015/08/05 18:05:25 Why does ShowMatchingBubbles(context); not work?
hcarmona 2015/08/05 18:43:47 Showing bubbles is easy. Figuring out which bubble
32 }
33
34 void ChromeBubbleManager::TabDetached(content::WebContents* context) {
35 HideMatchingBubbles(context, BUBBLE_CLOSE_TABSWITCH);
36 }
37
38 void ChromeBubbleManager::NavigationEntryCommitted(
39 content::WebContents* context,
40 const content::LoadCommittedDetails& details) {
41 // Hide bubbles if the URL changes or the page is refreshed.
42 if (!details.is_in_page ||
43 details.type == content::NAVIGATION_TYPE_SAME_PAGE ||
44 details.type == content::NAVIGATION_TYPE_EXISTING_PAGE) {
45 HideMatchingBubbles(context, BUBBLE_CLOSE_IGNORE);
46 }
47 }
48
49 void ChromeBubbleManager::WebContentsDestroyed(content::WebContents* context) {
50 HideMatchingBubbles(context, BUBBLE_CLOSE_IGNORE);
51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698