| OLD | NEW |
| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 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. | 228 // perform our cleanup here before opening the new tab. |
| 229 OnClose(); | 229 OnClose(); |
| 230 if (!g_should_ignore_learn_more_for_testing) { | 230 if (!g_should_ignore_learn_more_for_testing) { |
| 231 browser_->OpenURL( | 231 browser_->OpenURL(content::OpenURLParams( |
| 232 content::OpenURLParams(delegate_->GetLearnMoreUrl(), | 232 delegate_->GetLearnMoreUrl(), content::Referrer(), |
| 233 content::Referrer(), | 233 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, |
| 234 NEW_FOREGROUND_TAB, | 234 false)); |
| 235 ui::PAGE_TRANSITION_LINK, | |
| 236 false)); | |
| 237 } | 235 } |
| 238 // Warning: |this| may be deleted here! | 236 // Warning: |this| may be deleted here! |
| 239 } | 237 } |
| 240 | 238 |
| 241 void ExtensionMessageBubbleController::SetIsActiveBubble() { | 239 void ExtensionMessageBubbleController::SetIsActiveBubble() { |
| 242 DCHECK(!is_active_bubble_); | 240 DCHECK(!is_active_bubble_); |
| 243 DCHECK(!model_->has_active_bubble()); | 241 DCHECK(!model_->has_active_bubble()); |
| 244 is_active_bubble_ = true; | 242 is_active_bubble_ = true; |
| 245 model_->set_has_active_bubble(true); | 243 model_->set_has_active_bubble(true); |
| 246 } | 244 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 if (delegate_->ClearProfileSetAfterAction()) | 304 if (delegate_->ClearProfileSetAfterAction()) |
| 307 GetProfileSet()->clear(); | 305 GetProfileSet()->clear(); |
| 308 } | 306 } |
| 309 } | 307 } |
| 310 | 308 |
| 311 std::set<Profile*>* ExtensionMessageBubbleController::GetProfileSet() { | 309 std::set<Profile*>* ExtensionMessageBubbleController::GetProfileSet() { |
| 312 return &g_shown_for_profiles.Get()[delegate_->GetKey()]; | 310 return &g_shown_for_profiles.Get()[delegate_->GetKey()]; |
| 313 } | 311 } |
| 314 | 312 |
| 315 } // namespace extensions | 313 } // namespace extensions |
| OLD | NEW |