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

Unified Diff: chrome/browser/ui/views/toolbar/browser_actions_container.cc

Issue 307423003: Temporarily re-enabling SizeAfterPrefChange test with traces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_toolbar_model_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/browser_actions_container.cc
diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container.cc b/chrome/browser/ui/views/toolbar/browser_actions_container.cc
index 12e431f9db4482100c8cfc6ce9179772242cf63d..bd821453967a43803e945dc6506234d9a9ec1877 100644
--- a/chrome/browser/ui/views/toolbar/browser_actions_container.cc
+++ b/chrome/browser/ui/views/toolbar/browser_actions_container.cc
@@ -184,6 +184,8 @@ size_t BrowserActionsContainer::VisibleBrowserActions() const {
if (browser_action_views_[i]->visible())
++visible_actions;
}
+ VLOG(4) << "BAC::VisibleBrowserActions() returns " << visible_actions
+ << " with size=" << browser_action_views_.size();
return visible_actions;
}
@@ -672,10 +674,13 @@ void BrowserActionsContainer::BrowserActionAdded(const Extension* extension,
#endif
CloseOverflowMenu();
- if (!ShouldDisplayBrowserAction(extension))
+ if (!ShouldDisplayBrowserAction(extension)) {
+ VLOG(4) << "Should not display: " << extension->name().c_str();
return;
+ }
size_t visible_actions = VisibleBrowserActions();
+ VLOG(4) << "Got back " << visible_actions << " visible.";
// Add the new browser action to the vector and the view hierarchy.
if (profile_->IsOffTheRecord())
@@ -685,17 +690,21 @@ void BrowserActionsContainer::BrowserActionAdded(const Extension* extension,
AddChildViewAt(view, index);
// If we are still initializing the container, don't bother animating.
- if (!model_->extensions_initialized())
+ if (!model_->extensions_initialized()) {
+ VLOG(4) << "Still initializing";
return;
+ }
// Enlarge the container if it was already at maximum size and we're not in
// the middle of upgrading.
if ((model_->GetVisibleIconCount() < 0) &&
!extensions::ExtensionSystem::Get(profile_)->runtime_data()->
IsBeingUpgraded(extension)) {
+ VLOG(4) << "At max, Save and animate";
suppress_chevron_ = true;
SaveDesiredSizeAndAnimate(gfx::Tween::LINEAR, visible_actions + 1);
} else {
+ VLOG(4) << "Not at max";
// Just redraw the (possibly modified) visible icon set.
OnBrowserActionVisibilityChanged();
}
@@ -871,9 +880,12 @@ void BrowserActionsContainer::SaveDesiredSizeAndAnimate(
// NOTE: Don't save the icon count in incognito because there may be fewer
// icons in that mode. The result is that the container in a normal window is
// always at least as wide as in an incognito window.
- if (!profile_->IsOffTheRecord())
+ if (!profile_->IsOffTheRecord()) {
model_->SetVisibleIconCount(num_visible_icons);
-
+ VLOG(4) << "Setting visible count: " << num_visible_icons;
+ } else {
+ VLOG(4) << "|Skipping| setting visible count: " << num_visible_icons;
+ }
int target_size = IconCountToWidth(num_visible_icons,
num_visible_icons < browser_action_views_.size());
if (!disable_animations_during_testing_) {
« no previous file with comments | « chrome/browser/extensions/extension_toolbar_model_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698