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

Unified Diff: chrome/browser/extensions/extension_toolbar_model.cc

Issue 309533013: Add traces temporarily to track down flakiness in test. (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 | « no previous file | chrome/browser/extensions/extension_toolbar_model_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_toolbar_model.cc
diff --git a/chrome/browser/extensions/extension_toolbar_model.cc b/chrome/browser/extensions/extension_toolbar_model.cc
index 7779514cb8cb579f43f59f9556e2001e58b176a9..92ee8dea29628bcb6266b224549bb74d47cf4502 100644
--- a/chrome/browser/extensions/extension_toolbar_model.cc
+++ b/chrome/browser/extensions/extension_toolbar_model.cc
@@ -158,8 +158,13 @@ ExtensionToolbarModel::Action ExtensionToolbarModel::ExecuteBrowserAction(
}
void ExtensionToolbarModel::SetVisibleIconCount(int count) {
+ LOG(ERROR) << "visible_icon_count_ before: " << visible_icon_count_;
visible_icon_count_ =
count == static_cast<int>(toolbar_items_.size()) ? -1 : count;
+ LOG(ERROR) << "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).
@@ -171,16 +176,23 @@ void ExtensionToolbarModel::SetVisibleIconCount(int count) {
void ExtensionToolbarModel::OnExtensionLoaded(
content::BrowserContext* browser_context,
const Extension* extension) {
+ LOG(ERROR) << "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)
+ if (toolbar_items_[i].get() == extension) {
+ LOG(ERROR) << "... but returning early";
return;
+ }
}
if (ExtensionActionAPI::GetBrowserActionVisibility(extension_prefs_,
extension->id())) {
+ LOG(ERROR) << "Adding extensions";
AddExtension(extension);
+ } else {
+ LOG(ERROR) << "NOT visible";
}
}
@@ -218,8 +230,10 @@ void ExtensionToolbarModel::Observe(
ExtensionRegistry::EVERYTHING);
if (ExtensionActionAPI::GetBrowserActionVisibility(extension_prefs_,
extension->id())) {
+ LOG(ERROR) << "Adding extension";
AddExtension(extension);
} else {
+ LOG(ERROR) << "Removing extension";
RemoveExtension(extension);
}
}
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_toolbar_model_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698