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

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

Issue 1881773002: [Extensions UI] Convert ExtensionMessageBubbles to ToolbarActionsBarBubbles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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/extensions/blocked_action_bubble_delegate.h » ('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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 Delegate* delegate, 100 Delegate* delegate,
101 Browser* browser) 101 Browser* browser)
102 : browser_(browser), 102 : browser_(browser),
103 user_action_(ACTION_BOUNDARY), 103 user_action_(ACTION_BOUNDARY),
104 delegate_(delegate), 104 delegate_(delegate),
105 initialized_(false), 105 initialized_(false),
106 did_highlight_(false) { 106 did_highlight_(false) {
107 } 107 }
108 108
109 ExtensionMessageBubbleController::~ExtensionMessageBubbleController() { 109 ExtensionMessageBubbleController::~ExtensionMessageBubbleController() {
110 if (did_highlight_)
111 ToolbarActionsModel::Get(profile())->StopHighlighting();
110 } 112 }
111 113
112 Profile* ExtensionMessageBubbleController::profile() { 114 Profile* ExtensionMessageBubbleController::profile() {
113 return browser_->profile(); 115 return browser_->profile();
114 } 116 }
115 117
116 bool ExtensionMessageBubbleController::ShouldShow() { 118 bool ExtensionMessageBubbleController::ShouldShow() {
117 std::set<Profile*>* profiles = GetProfileSet(); 119 std::set<Profile*>* profiles = GetProfileSet();
118 return !profiles->count(profile()->GetOriginalProfile()) && 120 return !profiles->count(profile()->GetOriginalProfile()) &&
119 !GetExtensionList().empty(); 121 !GetExtensionList().empty();
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 void ExtensionMessageBubbleController::OnClose() { 267 void ExtensionMessageBubbleController::OnClose() {
266 DCHECK_NE(ACTION_BOUNDARY, user_action_); 268 DCHECK_NE(ACTION_BOUNDARY, user_action_);
267 // If the bubble was closed due to deactivation, don't treat it as 269 // If the bubble was closed due to deactivation, don't treat it as
268 // acknowledgment so that the user will see the bubble again (until they 270 // acknowledgment so that the user will see the bubble again (until they
269 // explicitly take an action). 271 // explicitly take an action).
270 if (user_action_ != ACTION_DISMISS_DEACTIVATION) { 272 if (user_action_ != ACTION_DISMISS_DEACTIVATION) {
271 AcknowledgeExtensions(); 273 AcknowledgeExtensions();
272 if (delegate_->ClearProfileSetAfterAction()) 274 if (delegate_->ClearProfileSetAfterAction())
273 GetProfileSet()->clear(); 275 GetProfileSet()->clear();
274 } 276 }
275
276 if (did_highlight_)
277 ToolbarActionsModel::Get(profile())->StopHighlighting();
278 } 277 }
279 278
280 std::set<Profile*>* ExtensionMessageBubbleController::GetProfileSet() { 279 std::set<Profile*>* ExtensionMessageBubbleController::GetProfileSet() {
281 return &g_shown_for_profiles.Get()[delegate_->GetKey()]; 280 return &g_shown_for_profiles.Get()[delegate_->GetKey()];
282 } 281 }
283 282
284 } // namespace extensions 283 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/extensions/blocked_action_bubble_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698