| 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/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 return *GetOrCreateExtensionList(); | 148 return *GetOrCreateExtensionList(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 bool ExtensionMessageBubbleController::CloseOnDeactivate() { return false; } | 151 bool ExtensionMessageBubbleController::CloseOnDeactivate() { return false; } |
| 152 | 152 |
| 153 void ExtensionMessageBubbleController::HighlightExtensionsIfNecessary() { | 153 void ExtensionMessageBubbleController::HighlightExtensionsIfNecessary() { |
| 154 if (delegate_->ShouldHighlightExtensions() && !did_highlight_) { | 154 if (delegate_->ShouldHighlightExtensions() && !did_highlight_) { |
| 155 did_highlight_ = true; | 155 did_highlight_ = true; |
| 156 const ExtensionIdList& extension_ids = GetExtensionIdList(); | 156 const ExtensionIdList& extension_ids = GetExtensionIdList(); |
| 157 DCHECK(!extension_ids.empty()); | 157 DCHECK(!extension_ids.empty()); |
| 158 ExtensionToolbarModel::Get(profile_)->HighlightExtensions(extension_ids); | 158 ExtensionToolbarModel::Get(profile_)->HighlightExtensions( |
| 159 extension_ids, ExtensionToolbarModel::HIGHLIGHT_WARNING); |
| 159 } | 160 } |
| 160 } | 161 } |
| 161 | 162 |
| 162 void ExtensionMessageBubbleController::Show(ExtensionMessageBubble* bubble) { | 163 void ExtensionMessageBubbleController::Show(ExtensionMessageBubble* bubble) { |
| 163 bubble->Show(); | 164 bubble->Show(); |
| 164 } | 165 } |
| 165 | 166 |
| 166 void ExtensionMessageBubbleController::OnBubbleAction() { | 167 void ExtensionMessageBubbleController::OnBubbleAction() { |
| 167 DCHECK_EQ(ACTION_BOUNDARY, user_action_); | 168 DCHECK_EQ(ACTION_BOUNDARY, user_action_); |
| 168 user_action_ = ACTION_EXECUTE; | 169 user_action_ = ACTION_EXECUTE; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 return &extension_list_; | 234 return &extension_list_; |
| 234 } | 235 } |
| 235 | 236 |
| 236 void ExtensionMessageBubbleController::OnClose() { | 237 void ExtensionMessageBubbleController::OnClose() { |
| 237 AcknowledgeExtensions(); | 238 AcknowledgeExtensions(); |
| 238 if (did_highlight_) | 239 if (did_highlight_) |
| 239 ExtensionToolbarModel::Get(profile_)->StopHighlighting(); | 240 ExtensionToolbarModel::Get(profile_)->StopHighlighting(); |
| 240 } | 241 } |
| 241 | 242 |
| 242 } // namespace extensions | 243 } // namespace extensions |
| OLD | NEW |