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

Side by Side Diff: chrome/browser/extensions/extension_message_bubble_controller.cc

Issue 2086193002: [Extensions UI] Fix a crash when clicking on a bubble's learn more (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Views clicking Created 4 years, 6 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 | chrome/browser/ui/cocoa/extensions/extension_message_bubble_browsertest_mac.mm » ('j') | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/extensions/extension_message_bubble_controller.h" 5 #include "chrome/browser/extensions/extension_message_bubble_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 delegate_->LogAction(user_action_); 217 delegate_->LogAction(user_action_);
218 218
219 OnClose(); 219 OnClose();
220 } 220 }
221 221
222 void ExtensionMessageBubbleController::OnLinkClicked() { 222 void ExtensionMessageBubbleController::OnLinkClicked() {
223 DCHECK_EQ(ACTION_BOUNDARY, user_action_); 223 DCHECK_EQ(ACTION_BOUNDARY, user_action_);
224 user_action_ = ACTION_LEARN_MORE; 224 user_action_ = ACTION_LEARN_MORE;
225 225
226 delegate_->LogAction(ACTION_LEARN_MORE); 226 delegate_->LogAction(ACTION_LEARN_MORE);
227 // Opening a new tab for the learn more link can cause the bubble to close, so
228 // perform our cleanup here before opening the new tab.
229 OnClose();
227 if (!g_should_ignore_learn_more_for_testing) { 230 if (!g_should_ignore_learn_more_for_testing) {
228 browser_->OpenURL( 231 browser_->OpenURL(
229 content::OpenURLParams(delegate_->GetLearnMoreUrl(), 232 content::OpenURLParams(delegate_->GetLearnMoreUrl(),
230 content::Referrer(), 233 content::Referrer(),
231 NEW_FOREGROUND_TAB, 234 NEW_FOREGROUND_TAB,
232 ui::PAGE_TRANSITION_LINK, 235 ui::PAGE_TRANSITION_LINK,
233 false)); 236 false));
234 } 237 }
235 OnClose(); 238 // Warning: |this| may be deleted here!
236 } 239 }
237 240
238 void ExtensionMessageBubbleController::SetIsActiveBubble() { 241 void ExtensionMessageBubbleController::SetIsActiveBubble() {
239 DCHECK(!is_active_bubble_); 242 DCHECK(!is_active_bubble_);
240 DCHECK(!model_->has_active_bubble()); 243 DCHECK(!model_->has_active_bubble());
241 is_active_bubble_ = true; 244 is_active_bubble_ = true;
242 model_->set_has_active_bubble(true); 245 model_->set_has_active_bubble(true);
243 } 246 }
244 247
245 void ExtensionMessageBubbleController::ClearProfileListForTesting() { 248 void ExtensionMessageBubbleController::ClearProfileListForTesting() {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 if (delegate_->ClearProfileSetAfterAction()) 306 if (delegate_->ClearProfileSetAfterAction())
304 GetProfileSet()->clear(); 307 GetProfileSet()->clear();
305 } 308 }
306 } 309 }
307 310
308 std::set<Profile*>* ExtensionMessageBubbleController::GetProfileSet() { 311 std::set<Profile*>* ExtensionMessageBubbleController::GetProfileSet() {
309 return &g_shown_for_profiles.Get()[delegate_->GetKey()]; 312 return &g_shown_for_profiles.Get()[delegate_->GetKey()];
310 } 313 }
311 314
312 } // namespace extensions 315 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/extensions/extension_message_bubble_browsertest_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698