Index: chrome/browser/ui/views/settings_api_bubble_helper_views.cc |
diff --git a/chrome/browser/ui/views/settings_api_bubble_helper_views.cc b/chrome/browser/ui/views/settings_api_bubble_helper_views.cc |
index 06bb439ba617861a3223bcf3586f2443a2e971d1..341dc6124bff781ab9d1861ac6e3c582ef118f0b 100644 |
--- a/chrome/browser/ui/views/settings_api_bubble_helper_views.cc |
+++ b/chrome/browser/ui/views/settings_api_bubble_helper_views.cc |
@@ -25,12 +25,13 @@ |
namespace { |
void ShowSettingsApiBubble(SettingsApiOverrideType type, |
+ const std::string& extension_id, |
Profile* profile, |
views::View* anchor_view, |
views::BubbleBorder::Arrow arrow) { |
scoped_ptr<SettingsApiBubbleController> settings_api_bubble( |
new SettingsApiBubbleController(profile, type)); |
- if (!settings_api_bubble->ShouldShow()) |
+ if (!settings_api_bubble->ShouldShow(extension_id)) |
return; |
SettingsApiBubbleController* controller = settings_api_bubble.get(); |
@@ -47,13 +48,18 @@ |
return; |
#endif |
- // The bubble will try to anchor itself against the home button |
- views::View* anchor_view = BrowserView::GetBrowserViewForBrowser(browser)-> |
- toolbar()->home_button(); |
- ShowSettingsApiBubble(BUBBLE_TYPE_HOME_PAGE, |
- browser->profile(), |
- anchor_view, |
- views::BubbleBorder::TOP_LEFT); |
+ const Extension* extension = |
+ GetExtensionOverridingHomepage(browser->profile()); |
+ if (extension) { |
+ // The bubble will try to anchor itself against the home button |
+ views::View* anchor_view = BrowserView::GetBrowserViewForBrowser(browser)-> |
+ toolbar()->home_button(); |
+ ShowSettingsApiBubble(BUBBLE_TYPE_HOME_PAGE, |
+ extension->id(), |
+ browser->profile(), |
+ anchor_view, |
+ views::BubbleBorder::TOP_LEFT); |
+ } |
} |
void MaybeShowExtensionControlledSearchNotification( |
@@ -66,13 +72,17 @@ |
if (AutocompleteMatch::IsSearchType(match.type) && |
match.type != AutocompleteMatchType::SEARCH_OTHER_ENGINE) { |
- ToolbarView* toolbar = |
- BrowserView::GetBrowserViewForBrowser( |
- chrome::FindBrowserWithWebContents(web_contents))->toolbar(); |
- ShowSettingsApiBubble(BUBBLE_TYPE_SEARCH_ENGINE, |
- profile, |
- toolbar->app_menu(), |
- views::BubbleBorder::TOP_RIGHT); |
+ const Extension* extension = GetExtensionOverridingSearchEngine(profile); |
+ if (extension) { |
+ ToolbarView* toolbar = |
+ BrowserView::GetBrowserViewForBrowser( |
+ chrome::FindBrowserWithWebContents(web_contents))->toolbar(); |
+ ShowSettingsApiBubble(BUBBLE_TYPE_SEARCH_ENGINE, |
+ extension->id(), |
+ profile, |
+ toolbar->app_menu(), |
+ views::BubbleBorder::TOP_RIGHT); |
+ } |
} |
} |