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

Unified Diff: chrome/browser/ui/toolbar/toolbar_action_view_delegate.h

Issue 670463004: Make a platform-independent ToolbarActionViewController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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_action_view_delegate.h
diff --git a/chrome/browser/ui/toolbar/toolbar_action_view_delegate.h b/chrome/browser/ui/toolbar/toolbar_action_view_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..2d6097207a8bb9dd84f219f040592e40ddcb5f08
--- /dev/null
+++ b/chrome/browser/ui/toolbar/toolbar_action_view_delegate.h
@@ -0,0 +1,33 @@
+// 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_TOOLBAR_TOOLBAR_ACTION_VIEW_DELEGATE_H_
+#define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTION_VIEW_DELEGATE_H_
+
+class ToolbarActionViewController;
+
+namespace content {
+class WebContents;
+}
+
+// The view that surrounds a ToolbarAction and typically owns the
+// ToolbarActionViewController.
+class ToolbarActionViewDelegate {
+ public:
+ // In some cases (such as when an action is shown in a menu), a substitute
+ // ToolbarActionViewController should be used for showing popups. This
+ // returns the preferred controller.
+ virtual ToolbarActionViewController* GetPreferredPopupViewController() = 0;
+
+ // Returns the current web contents.
+ virtual content::WebContents* GetCurrentWebContents() const = 0;
+
+ // Updates the view to reflect current state.
+ virtual void UpdateState() = 0;
+
+ protected:
+ virtual ~ToolbarActionViewDelegate() {}
+};
+
+#endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTION_VIEW_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698