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

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

Issue 2355963002: Avert crash in ExtensionInstalledBubbleView::GetWindowTitle triggered (Closed)
Patch Set: Created 4 years, 3 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
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; 169 controller_ = nullptr;
170 GetWidget()->Close(); 170 GetWidget()->Close();
171 } 171 }
172 172
173 base::string16 ExtensionInstalledBubbleView::GetWindowTitle() const { 173 base::string16 ExtensionInstalledBubbleView::GetWindowTitle() const {
Devlin 2016/09/20 20:15:43 Is there any way we could detect the view is close
174 // This may be called by screen readers after the window is closed.
175 // See crbug.com/648280
176 if (!controller_)
177 return base::string16();
178
174 // Add the heading (for all options). 179 // Add the heading (for all options).
175 base::string16 extension_name = 180 base::string16 extension_name =
176 base::UTF8ToUTF16(controller_->extension()->name()); 181 base::UTF8ToUTF16(controller_->extension()->name());
177 base::i18n::AdjustStringForLocaleDirection(&extension_name); 182 base::i18n::AdjustStringForLocaleDirection(&extension_name);
178 return l10n_util::GetStringFUTF16(IDS_EXTENSION_INSTALLED_HEADING, 183 return l10n_util::GetStringFUTF16(IDS_EXTENSION_INSTALLED_HEADING,
179 extension_name); 184 extension_name);
180 } 185 }
181 186
182 gfx::ImageSkia ExtensionInstalledBubbleView::GetWindowIcon() { 187 gfx::ImageSkia ExtensionInstalledBubbleView::GetWindowIcon() {
183 const SkBitmap& bitmap = controller_->icon(); 188 const SkBitmap& bitmap = controller_->icon();
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 ->browser_actions(); 358 ->browser_actions();
354 return !container->animating(); 359 return !container->animating();
355 } 360 }
356 return true; 361 return true;
357 } 362 }
358 363
359 // Implemented here to create the platform specific instance of the BubbleUi. 364 // Implemented here to create the platform specific instance of the BubbleUi.
360 std::unique_ptr<BubbleUi> ExtensionInstalledBubble::BuildBubbleUi() { 365 std::unique_ptr<BubbleUi> ExtensionInstalledBubble::BuildBubbleUi() {
361 return base::WrapUnique(new ExtensionInstalledBubbleUi(this)); 366 return base::WrapUnique(new ExtensionInstalledBubbleUi(this));
362 } 367 }
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