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

Unified Diff: chrome/browser/ui/toolbar/toolbar_actions_bar.cc

Issue 1246643004: [Extensions UI] Highlight toolbar extensions when the redesign bubble is active (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
Index: chrome/browser/ui/toolbar/toolbar_actions_bar.cc
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
index 31600f6974fe2f5f51648ce5fd554cd2bec938fc..bbe755b34f80cbaf9d02446450f9927f7f166699 100644
--- a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
+++ b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
@@ -303,6 +303,27 @@ ToolbarActionsBar::GetActions() const {
return actions;
}
+ToolbarActionsBar::HighlightType ToolbarActionsBar::GetHighlightType() const {
+ // TODO(devlin): This mapping is to avoid platform-specific ui implementations
+ // have a dependency on the ExtensionToolbarModel, but is a little odd. It
+ // would be better to just be able to return the set of images for the
+ // highlight here, but it's hard to do nicely since it's a nine-grid.
Peter Kasting 2015/07/23 00:00:12 Maybe this all becomes better if you return one im
Devlin 2015/07/23 02:43:30 It could be better with a single image, but see ot
Peter Kasting 2015/07/23 05:40:53 I guess I'd probably ask the same thing with the r
Devlin 2015/07/23 15:30:13 Benefit's not substantial enough. Removed the map
+ HighlightType type = HIGHLIGHT_NONE;
+ if (model_ && model_->extensions_initialized()) {
+ switch (model_->highlight_type()) {
+ case extensions::ExtensionToolbarModel::HIGHLIGHT_NONE:
+ break; // Already HIGHLIGHT_TYPE_NONE
+ case extensions::ExtensionToolbarModel::HIGHLIGHT_INFO:
+ type = HIGHLIGHT_INFO;
+ break;
+ case extensions::ExtensionToolbarModel::HIGHLIGHT_WARNING:
+ type = HIGHLIGHT_WARNING;
+ break;
+ }
+ }
+ return type;
+}
+
void ToolbarActionsBar::CreateActions() {
DCHECK(toolbar_actions_.empty());
// We wait for the extension system to be initialized before we add any
@@ -372,7 +393,7 @@ void ToolbarActionsBar::CreateActions() {
// CreateActions() can be called multiple times, so we need to make sure we
// haven't already shown the bubble.
- if (!checked_extension_bubble_) {
+ if (!checked_extension_bubble_ && !is_highlighting()) {
Peter Kasting 2015/07/23 00:00:12 I'm not totally clear on why this was added...
Devlin 2015/07/23 02:43:30 Extension bubbles can cause a subsection of extens
Peter Kasting 2015/07/23 05:40:53 Ahhhh. Once again, might be worth a descriptive c
Devlin 2015/07/23 15:30:13 Done.
checked_extension_bubble_ = true;
// CreateActions() can be called as part of the browser window set up, which
// we need to let finish before showing the actions.
@@ -664,6 +685,8 @@ void ToolbarActionsBar::ResizeDelegate(gfx::Tween::Type tween_type,
}
void ToolbarActionsBar::OnToolbarHighlightModeChanged(bool is_highlighting) {
+ if (!model_->extensions_initialized())
+ return;
// It's a bit of a pain that we delete and recreate everything here, but given
// everything else going on (the lack of highlight, [n] more extensions
// appearing, etc), it's not worth the extra complexity to create and insert

Powered by Google App Engine
This is Rietveld 408576698