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

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

Issue 661493004: Add infrastructure for Chrome Actions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/views/toolbar/browser_actions_container.h
diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container.h b/chrome/browser/ui/views/toolbar/browser_actions_container.h
index 17907b9596a7992331c6f9606ef87f0fc7a13ce0..afe197ef34b2e3013f0c3c9ac8c423e552ae626a 100644
--- a/chrome/browser/ui/views/toolbar/browser_actions_container.h
+++ b/chrome/browser/ui/views/toolbar/browser_actions_container.h
@@ -141,8 +141,9 @@ class BrowserActionsContainer
void Init();
- // Get the number of browser actions being displayed.
+ // Get the number of actions being displayed.
size_t num_browser_actions() const { return browser_action_views_.size(); }
+ size_t num_chrome_actions() const { return chrome_action_views_.size(); }
// Whether we are performing resize animation on the container.
bool animating() const { return animation_target_size_ > 0; }
@@ -164,19 +165,27 @@ class BrowserActionsContainer
return browser_action_views_[index];
}
+ // Get a particular chrome action view.
+ BrowserActionView* GetChromeActionViewAt(size_t index) {
+ return chrome_action_views_[index];
+ }
+
+ // Returns the extension of the view of the given |index|.
+ const extensions::Extension* GetExtensionAt(size_t index) const;
+
// Returns the BrowserActionView* associated with the given |extension|, or
// NULL if none exists.
BrowserActionView* GetViewForExtension(
const extensions::Extension* extension);
- // Update the views to reflect the state of the browser action icons.
- void RefreshBrowserActionViews();
+ // Update the views to reflect the current state of the actions.
+ void RefreshActionViews();
- // Sets up the browser action view vector.
- void CreateBrowserActionViews();
+ // Sets up the browser action views and chrome action views vectors.
+ void CreateActionViews();
- // Delete all browser action views.
- void DeleteBrowserActionViews();
+ // Delete all action views.
+ void DeleteActionViews();
// Returns how many browser actions are currently visible. If the intent is
// to find how many are visible once the container finishes animation, see
@@ -238,8 +247,8 @@ class BrowserActionsContainer
virtual views::MenuButton* GetOverflowReferenceView() override;
virtual void SetPopupOwner(BrowserActionView* popup_owner) override;
virtual void HideActivePopup() override;
- virtual BrowserActionView* GetMainViewForExtension(
- const extensions::Extension* extension) override;
+ virtual BrowserActionView* GetMainViewForAction(
+ BrowserActionView* view) override;
// Overridden from extension::ExtensionKeybindingRegistry::Delegate:
virtual extensions::ActiveTabPermissionGranter*
@@ -340,6 +349,9 @@ class BrowserActionsContainer
// this collection. Some extensions may be disabled in incognito windows.
BrowserActionViews browser_action_views_;
+ // The collection of views representing chrome actions.
+ BrowserActionViews chrome_action_views_;
+
Profile* profile_;
// The Browser object the container is associated with.

Powered by Google App Engine
This is Rietveld 408576698