Commit 0c727940 authored by finnur@chromium.org's avatar finnur@chromium.org

Remove log statements that are no longer needed.

The test hasn't failed since I submitted my fix.

BUG=379170
TBR=sky

Review URL: https://codereview.chromium.org/312093006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275667 0039d316-1c4b-4281-b951-d872f2087c98
parent 8df04628
......@@ -158,41 +158,28 @@ ExtensionToolbarModel::Action ExtensionToolbarModel::ExecuteBrowserAction(
}
void ExtensionToolbarModel::SetVisibleIconCount(int count) {
VLOG(4) << "visible_icon_count_ before: " << visible_icon_count_;
visible_icon_count_ =
count == static_cast<int>(toolbar_items_.size()) ? -1 : count;
VLOG(4) << "SetVisibleIconCount "
<< count << " == " << toolbar_items_.size() << " -> "
<< visible_icon_count_ << " "
<< "is_highlighting: " << is_highlighting_;
// Only set the prefs if we're not in highlight mode. Highlight mode is
// designed to be a transitory state, and should not persist across browser
// restarts (though it may be re-entered).
if (!is_highlighting_) {
if (!is_highlighting_)
prefs_->SetInteger(pref_names::kToolbarSize, visible_icon_count_);
}
}
void ExtensionToolbarModel::OnExtensionLoaded(
content::BrowserContext* browser_context,
const Extension* extension) {
VLOG(4) << "Loading extension";
// We don't want to add the same extension twice. It may have already been
// added by EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED below, if the user
// hides the browser action and then disables and enables the extension.
for (size_t i = 0; i < toolbar_items_.size(); i++) {
if (toolbar_items_[i].get() == extension) {
VLOG(4) << "... but returning early";
if (toolbar_items_[i].get() == extension)
return;
}
}
if (ExtensionActionAPI::GetBrowserActionVisibility(extension_prefs_,
extension->id())) {
VLOG(4) << "Adding extensions";
AddExtension(extension);
} else {
VLOG(4) << "NOT visible";
}
}
......@@ -229,17 +216,13 @@ void ExtensionToolbarModel::Observe(
*content::Details<const std::string>(details).ptr(),
ExtensionRegistry::EVERYTHING);
if (ExtensionActionAPI::GetBrowserActionVisibility(extension_prefs_,
extension->id())) {
VLOG(4) << "Adding extension";
extension->id()))
AddExtension(extension);
} else {
VLOG(4) << "Removing extension";
else
RemoveExtension(extension);
}
}
void ExtensionToolbarModel::OnReady() {
VLOG(4) << "OnReady called";
ExtensionRegistry* registry = ExtensionRegistry::Get(profile_);
InitializeExtensionList(registry->enabled_extensions());
// Wait until the extension system is ready before observing any further
......@@ -353,7 +336,6 @@ void ExtensionToolbarModel::InitializeExtensionList(
last_known_positions_ = extension_prefs_->GetToolbarOrder();
Populate(last_known_positions_, extensions);
VLOG(4) << "extensions_initialized!";
extensions_initialized_ = true;
FOR_EACH_OBSERVER(Observer, observers_, VisibleCountChanged());
}
......
......@@ -27,14 +27,6 @@ class ExtensionToolbarModelTest : public ExtensionBrowserTest,
ExtensionBrowserTest::SetUp();
}
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
ExtensionBrowserTest::SetUpCommandLine(command_line);
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
command_line->AppendSwitchNative(
"vmodule", "*extension_toolbar_model*=4,*browser_actions_container*=4");
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
}
virtual void SetUpOnMainThread() OVERRIDE {
model_ = ExtensionToolbarModel::Get(browser()->profile());
model_->AddObserver(this);
......@@ -599,26 +591,19 @@ IN_PROC_BROWSER_TEST_F(ExtensionToolbarModelTest, SizeAfterPrefChange) {
base::FilePath extension_a_path(test_data_dir_.AppendASCII("api_test")
.AppendASCII("browser_action")
.AppendASCII("basics"));
VLOG(4) << "Loading [basics]";
ASSERT_TRUE(LoadExtension(extension_a_path));
base::FilePath extension_b_path(test_data_dir_.AppendASCII("api_test")
.AppendASCII("browser_action")
.AppendASCII("popup"));
VLOG(4) << "Loading [popup]";
ASSERT_TRUE(LoadExtension(extension_b_path));
std::string id_a = ExtensionAt(0)->id();
std::string id_b = ExtensionAt(1)->id();
VLOG(4) << "GetVisibleIconCount";
// Should be at max size (-1).
EXPECT_EQ(-1, model_->GetVisibleIconCount());
VLOG(4) << "OnExtensionToolbarPrefChange";
model_->OnExtensionToolbarPrefChange();
VLOG(4) << "GetVisibleIconCount";
// Should still be at max size.
EXPECT_EQ(-1, model_->GetVisibleIconCount());
}
......
......@@ -184,8 +184,6 @@ 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;
}
......@@ -193,11 +191,7 @@ size_t BrowserActionsContainer::VisibleBrowserActionsAfterAnimation() const {
if (!animating())
return VisibleBrowserActions();
size_t visible_actions = WidthToIconCount(animation_target_size_);
VLOG(4) << "BAC::VisibleBrowserActionsAfterAnimation() returns "
<< visible_actions
<< " with size=" << browser_action_views_.size();
return visible_actions;
return WidthToIconCount(animation_target_size_);
}
void BrowserActionsContainer::ExecuteExtensionCommand(
......@@ -685,13 +679,10 @@ void BrowserActionsContainer::BrowserActionAdded(const Extension* extension,
#endif
CloseOverflowMenu();
if (!ShouldDisplayBrowserAction(extension)) {
VLOG(4) << "Should not display: " << extension->name().c_str();
if (!ShouldDisplayBrowserAction(extension))
return;
}
size_t visible_actions = VisibleBrowserActionsAfterAnimation();
VLOG(4) << "Got back " << visible_actions << " visible.";
// Add the new browser action to the vector and the view hierarchy.
if (profile_->IsOffTheRecord())
......@@ -701,21 +692,17 @@ void BrowserActionsContainer::BrowserActionAdded(const Extension* extension,
AddChildViewAt(view, index);
// If we are still initializing the container, don't bother animating.
if (!model_->extensions_initialized()) {
VLOG(4) << "Still initializing";
if (!model_->extensions_initialized())
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();
}
......@@ -891,12 +878,8 @@ 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_) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment