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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc

Issue 2409713002: Don't clear controller_ in ExtensionInstalledBubbleView::CloseBubble. (Closed)
Patch Set: Created 4 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/metrics/user_metrics_action.h" 10 #include "base/metrics/user_metrics_action.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 break; 150 break;
151 } 151 }
152 152
153 // Default case. 153 // Default case.
154 if (!reference_view || !reference_view->visible()) 154 if (!reference_view || !reference_view->visible())
155 reference_view = browser_view->toolbar()->app_menu_button(); 155 reference_view = browser_view->toolbar()->app_menu_button();
156 SetAnchorView(reference_view); 156 SetAnchorView(reference_view);
157 } 157 }
158 158
159 void ExtensionInstalledBubbleView::CloseBubble() { 159 void ExtensionInstalledBubbleView::CloseBubble() {
160 if (controller_ && controller_->anchor_position() == 160 if (controller_ && controller_->anchor_position() ==
Devlin 2016/10/10 18:53:18 if it is safe to remove the null-out, then we can
Evan Stade 2016/10/26 14:16:54 Done.
161 ExtensionInstalledBubble::ANCHOR_PAGE_ACTION) { 161 ExtensionInstalledBubble::ANCHOR_PAGE_ACTION) {
162 BrowserView* browser_view = 162 BrowserView* browser_view =
163 BrowserView::GetBrowserViewForBrowser(browser()); 163 BrowserView::GetBrowserViewForBrowser(browser());
164 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( 164 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction(
165 extensions::ExtensionActionManager::Get(browser()->profile()) 165 extensions::ExtensionActionManager::Get(browser()->profile())
166 ->GetPageAction(*controller_->extension()), 166 ->GetPageAction(*controller_->extension()),
167 false); // preview_enabled 167 false); // preview_enabled
168 } 168 }
169 controller_ = nullptr;
Devlin 2016/10/10 18:53:17 My guess is that this was because the lifetime of
Evan Stade 2016/10/10 21:30:18 no
Devlin 2016/10/10 21:41:21 My guess is that users can trigger some pretty fun
Devlin 2016/10/25 22:09:26 If we're going to remove this, can we add a did_cl
Evan Stade 2016/10/26 14:16:53 added a dcheck
170 GetWidget()->Close(); 169 GetWidget()->Close();
171 } 170 }
172 171
173 base::string16 ExtensionInstalledBubbleView::GetWindowTitle() const { 172 base::string16 ExtensionInstalledBubbleView::GetWindowTitle() const {
174 // Add the heading (for all options). 173 // Add the heading (for all options).
175 base::string16 extension_name = 174 base::string16 extension_name =
176 base::UTF8ToUTF16(controller_->extension()->name()); 175 base::UTF8ToUTF16(controller_->extension()->name());
177 base::i18n::AdjustStringForLocaleDirection(&extension_name); 176 base::i18n::AdjustStringForLocaleDirection(&extension_name);
178 return l10n_util::GetStringFUTF16(IDS_EXTENSION_INSTALLED_HEADING, 177 return l10n_util::GetStringFUTF16(IDS_EXTENSION_INSTALLED_HEADING,
179 extension_name); 178 extension_name);
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 ->browser_actions(); 352 ->browser_actions();
354 return !container->animating(); 353 return !container->animating();
355 } 354 }
356 return true; 355 return true;
357 } 356 }
358 357
359 // Implemented here to create the platform specific instance of the BubbleUi. 358 // Implemented here to create the platform specific instance of the BubbleUi.
360 std::unique_ptr<BubbleUi> ExtensionInstalledBubble::BuildBubbleUi() { 359 std::unique_ptr<BubbleUi> ExtensionInstalledBubble::BuildBubbleUi() {
361 return base::WrapUnique(new ExtensionInstalledBubbleUi(this)); 360 return base::WrapUnique(new ExtensionInstalledBubbleUi(this));
362 } 361 }
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