| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/extensions/settings_api_bubble_helpers.h" | 5 #include "chrome/browser/ui/extensions/settings_api_bubble_helpers.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/extensions/ntp_overridden_bubble_delegate.h" | 10 #include "chrome/browser/extensions/ntp_overridden_bubble_delegate.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 void MaybeShowExtensionControlledSearchNotification( | 58 void MaybeShowExtensionControlledSearchNotification( |
| 59 content::WebContents* web_contents, | 59 content::WebContents* web_contents, |
| 60 AutocompleteMatch::Type match_type) { | 60 AutocompleteMatch::Type match_type) { |
| 61 #if !defined(OS_WIN) && !defined(OS_MACOSX) | 61 #if !defined(OS_WIN) && !defined(OS_MACOSX) |
| 62 return; | 62 return; |
| 63 #endif | 63 #endif |
| 64 | 64 |
| 65 if (AutocompleteMatch::IsSearchType(match_type) && | 65 if (AutocompleteMatch::IsSearchType(match_type) && |
| 66 match_type != AutocompleteMatchType::SEARCH_OTHER_ENGINE) { | 66 match_type != AutocompleteMatchType::SEARCH_OTHER_ENGINE) { |
| 67 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); | 67 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); |
| 68 ShowSettingsApiBubble(BUBBLE_TYPE_SEARCH_ENGINE, browser); | 68 if (browser) |
| 69 ShowSettingsApiBubble(BUBBLE_TYPE_SEARCH_ENGINE, browser); |
| 69 } | 70 } |
| 70 } | 71 } |
| 71 | 72 |
| 72 void MaybeShowExtensionControlledNewTabPage( | 73 void MaybeShowExtensionControlledNewTabPage( |
| 73 Browser* browser, content::WebContents* web_contents) { | 74 Browser* browser, content::WebContents* web_contents) { |
| 74 #if !defined(OS_WIN) | 75 #if !defined(OS_WIN) |
| 75 return; | 76 return; |
| 76 #endif | 77 #endif |
| 77 | 78 |
| 78 content::NavigationEntry* entry = | 79 content::NavigationEntry* entry = |
| (...skipping 26 matching lines...) Expand all Loading... |
| 105 | 106 |
| 106 ntp_overridden_bubble->SetIsActiveBubble(); | 107 ntp_overridden_bubble->SetIsActiveBubble(); |
| 107 ToolbarActionsBar* toolbar_actions_bar = | 108 ToolbarActionsBar* toolbar_actions_bar = |
| 108 browser->window()->GetToolbarActionsBar(); | 109 browser->window()->GetToolbarActionsBar(); |
| 109 std::unique_ptr<ToolbarActionsBarBubbleDelegate> bridge( | 110 std::unique_ptr<ToolbarActionsBarBubbleDelegate> bridge( |
| 110 new ExtensionMessageBubbleBridge(std::move(ntp_overridden_bubble))); | 111 new ExtensionMessageBubbleBridge(std::move(ntp_overridden_bubble))); |
| 111 toolbar_actions_bar->ShowToolbarActionBubbleAsync(std::move(bridge)); | 112 toolbar_actions_bar->ShowToolbarActionBubbleAsync(std::move(bridge)); |
| 112 } | 113 } |
| 113 | 114 |
| 114 } // namespace extensions | 115 } // namespace extensions |
| OLD | NEW |