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

Side by Side Diff: chrome/browser/ui/extensions/settings_api_bubble_helpers.cc

Issue 2191713003: [Extensions UI] Check for a browser not being found (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698