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

Unified Diff: chrome/browser/gtk/tabs/tab_button_gtk.h

Issue 108035: Remove the no-longer used TabButtonGtk class. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 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 | « no previous file | chrome/browser/gtk/tabs/tab_button_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/tabs/tab_button_gtk.h
===================================================================
--- chrome/browser/gtk/tabs/tab_button_gtk.h (revision 15329)
+++ chrome/browser/gtk/tabs/tab_button_gtk.h (working copy)
@@ -1,106 +0,0 @@
-// Copyright (c) 2009 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_GTK_TABS_TAB_BUTTON_GTK_H_
-#define CHROME_BROWSER_GTK_TABS_TAB_BUTTON_GTK_H_
-
-#include <gdk/gdk.h>
-
-#include "base/gfx/rect.h"
-#include "chrome/browser/tabs/tab_strip_model.h"
-#include "chrome/common/gfx/chrome_canvas.h"
-#include "skia/include/SkBitmap.h"
-
-///////////////////////////////////////////////////////////////////////////////
-// TabButtonGtk
-//
-// Performs hit-testing and rendering of a Tab button.
-//
-class TabButtonGtk {
- public:
- // Possible button states
- enum ButtonState {
- BS_NORMAL,
- BS_HOT,
- BS_PUSHED,
- BS_COUNT
- };
-
- class Delegate {
- public:
- // Creates a clickable region of the button's visual representation used
- // for hit-testing. Caller is responsible for destroying the region. If
- // NULL is returned, the bounds of the button will be used for hit-testing.
- virtual GdkRegion* MakeRegionForButton(
- const TabButtonGtk* button) const = 0;
-
- // Sent when the user activates the button, which is defined as a press
- // and release of a mouse click over the button.
- virtual void OnButtonActivate(const TabButtonGtk* button) = 0;
- };
-
- explicit TabButtonGtk(Delegate* delegate);
- virtual ~TabButtonGtk();
-
- // Returns the bounds of the button.
- int x() const { return bounds_.x(); }
- int y() const { return bounds_.y(); }
- int width() const { return bounds_.width(); }
- int height() const { return bounds_.height(); }
-
- const gfx::Rect& bounds() const { return bounds_; }
-
- // Sets the bounds of the button.
- void set_bounds(const gfx::Rect& bounds) { bounds_ = bounds; }
-
- // Checks whether |point| is inside the bounds of the button.
- bool IsPointInBounds(const gfx::Point& point);
-
- // Sent by the tabstrip when the mouse moves within this button. Mouse state
- // is in |event|. Returns true if the tabstrip needs to be redrawn as a
- // result of the motion.
- bool OnMotionNotify(GdkEventMotion* event);
-
- // Sent by the tabstrip when the mouse clicks within this button. Returns
- // true if the tabstrip needs to be redrawn as a result of the click.
- bool OnMousePress();
-
- // Sent by the tabstrip when the mouse click is released.
- void OnMouseRelease();
-
- // Sent by the tabstrip when the mouse leaves this button. Returns true
- // if the tabstrip needs to be redrawn as a result of the movement.
- bool OnLeaveNotify();
-
- // Paints the Tab button into |canvas|.
- void Paint(ChromeCanvasPaint* canvas);
-
- // Sets the image the button should use for the provided state.
- void SetImage(ButtonState state, SkBitmap* bitmap);
-
- private:
- // When the tab animation completes, we send the widget a message to
- // simulate a mouse moved event at the current mouse position. This tickles
- // the button to show the "hot" state.
- void HighlightTabButton();
-
- // The images used to render the different states of this button.
- SkBitmap images_[BS_COUNT];
-
- // The current state of the button.
- ButtonState state_;
-
- // The current bounds of the button.
- gfx::Rect bounds_;
-
- // Set if the mouse is pressed anywhere inside the button.
- bool mouse_pressed_;
-
- // Delegate to receive button messages.
- Delegate* delegate_;
-
- DISALLOW_COPY_AND_ASSIGN(TabButtonGtk);
-};
-
-#endif // CHROME_BROWSER_GTK_TABS_TAB_BUTTON_GTK_H_
« no previous file with comments | « no previous file | chrome/browser/gtk/tabs/tab_button_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698