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

Unified Diff: chrome/browser/ui/views/tabs/tab_controller.h

Issue 2210033002: Proper rendering of stacked tabs for MD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resync Created 4 years, 4 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 | « chrome/browser/ui/views/tabs/tab.cc ('k') | chrome/browser/ui/views/tabs/tab_strip.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_controller.h
diff --git a/chrome/browser/ui/views/tabs/tab_controller.h b/chrome/browser/ui/views/tabs/tab_controller.h
index 90d0d0d3670bfb4a0770f2e56eb5f4a95411061a..88e61a1847aeb997c3f689c6d99f958a013abbf3 100644
--- a/chrome/browser/ui/views/tabs/tab_controller.h
+++ b/chrome/browser/ui/views/tabs/tab_controller.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_
#define CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_
+#include "base/callback_forward.h"
#include "chrome/browser/ui/views/tabs/tab_strip_types.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/ui_base_types.h"
@@ -12,6 +13,7 @@
class Tab;
namespace gfx {
+class Path;
class Point;
class Size;
}
@@ -37,6 +39,9 @@ class TabController {
// to be hidden.
virtual bool ShouldHideCloseButtonForInactiveTabs() = 0;
+ // Returns true if ShouldPaintTab() could return a non-empty clip path.
+ virtual bool MaySetClip() = 0;
+
// Selects the tab.
virtual void SelectTab(Tab* tab) = 0;
@@ -92,10 +97,16 @@ class TabController {
virtual void OnMouseEventInTab(views::View* source,
const ui::MouseEvent& event) = 0;
- // Returns true if |tab| needs to be painted. If false is returned the tab is
- // not painted. If true is returned the tab should be painted and |clip| is
- // set to the clip (if |clip| is empty means no clip).
- virtual bool ShouldPaintTab(const Tab* tab, gfx::Rect* clip) = 0;
+ // Returns whether |tab| needs to be painted. When this returns true, |clip|
+ // is set to the path which should be clipped out of the current tab's region
+ // (for hit testing or painting), if any. |clip| is only non-empty when
+ // stacking tabs; if it is empty, no clipping is needed. |border_callback| is
+ // a callback which returns a tab's border given its size, and is used in
+ // computing |clip|.
+ virtual bool ShouldPaintTab(
+ const Tab* tab,
+ const base::Callback<gfx::Path(const gfx::Size&)>& border_callback,
+ gfx::Path* clip) = 0;
// Returns true if tab loading throbbers can be painted to a composited layer.
// This can only be done when the TabController can guarantee that nothing
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | chrome/browser/ui/views/tabs/tab_strip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698