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

Unified Diff: chrome/browser/ui/views/toolbar/chrome_actions_registry.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/chrome_actions_registry.h
diff --git a/chrome/browser/ui/views/toolbar/chrome_actions_registry.h b/chrome/browser/ui/views/toolbar/chrome_actions_registry.h
new file mode 100644
index 0000000000000000000000000000000000000000..02c5f543527e5e9b8812371f837701a04a9714d1
--- /dev/null
+++ b/chrome/browser/ui/views/toolbar/chrome_actions_registry.h
@@ -0,0 +1,30 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_CHROME_ACTIONS_REGISTRY_H_
sky 2014/10/15 23:52:30 I assume this is going to be on mac too? Shouldn't
Devlin 2014/10/16 16:46:38 I had it in ui/toolbar at first, but currently all
sky 2014/10/16 18:13:39 views on mac is a ways out, I don't even think the
Devlin 2014/10/16 22:05:27 Mmkay, promoted to ui/toolbar.
+#define CHROME_BROWSER_UI_VIEWS_TOOLBAR_CHROME_ACTIONS_REGISTRY_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_vector.h"
+
+class Profile;
+class ToolbarActionViewController;
+
+// The registry for all chrome actions. Chrome actions are actions that live in
+// the toolbar (like extension actions), but are components of chrome, such as
+// ChromeCast.
+class ChromeActionsRegistry {
sky 2014/10/15 23:52:30 nit: I don't think Chrome is very descriptive in t
Devlin 2014/10/16 16:46:38 Fair point regarding descriptiveness. I'm kind of
sky 2014/10/16 18:13:39 ic. Chrome is an umbrella term, and on a casual re
Devlin 2014/10/16 22:05:27 Is the new name from Patch Set 2 (ComponentToolbar
+ public:
+ // For readability, a pointer to a function that has the same signature as
+ // GetChromeActions().
+ typedef ScopedVector<ToolbarActionViewController> (*FactoryFunction)(void);
+
+ // Returns a collection of controllers for Chrome Actions.
+ static ScopedVector<ToolbarActionViewController> GetChromeActions();
+
+ // Set a substitute function to create the chrome actions for testing.
+ static void SetTestingChromeActionsFunction(FactoryFunction function);
sky 2014/10/15 23:52:30 Can tests inject an implementation of this class r
Devlin 2014/10/16 16:46:38 Sure. It actually seemed a little messier to me t
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_CHROME_ACTIONS_REGISTRY_H_

Powered by Google App Engine
This is Rietveld 408576698