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

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

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 | « chrome/browser/gtk/tabs/tab_button_gtk.h ('k') | chrome/browser/gtk/tabs/tab_strip_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.cc
===================================================================
--- chrome/browser/gtk/tabs/tab_button_gtk.cc (revision 15329)
+++ chrome/browser/gtk/tabs/tab_button_gtk.cc (working copy)
@@ -1,93 +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.
-
-#include "chrome/browser/gtk/tabs/tab_button_gtk.h"
-
-TabButtonGtk::TabButtonGtk(Delegate* delegate)
- : state_(BS_NORMAL),
- mouse_pressed_(false),
- delegate_(delegate) {
-}
-
-TabButtonGtk::~TabButtonGtk() {
-}
-
-bool TabButtonGtk::IsPointInBounds(const gfx::Point& point) {
- GdkRegion* region = delegate_->MakeRegionForButton(this);
- if (!region)
- return bounds_.Contains(point);
-
- bool in_bounds = (gdk_region_point_in(region, point.x(), point.y()) == TRUE);
- gdk_region_destroy(region);
- return in_bounds;
-}
-
-bool TabButtonGtk::OnMotionNotify(GdkEventMotion* event) {
- ButtonState state;
-
- gfx::Point point(event->x, event->y);
- if (IsPointInBounds(point)) {
- if (mouse_pressed_) {
- state = BS_PUSHED;
- } else {
- state = BS_HOT;
- }
- } else {
- state = BS_NORMAL;
- }
-
- bool need_redraw = (state_ != state);
- state_ = state;
- return need_redraw;
-}
-
-bool TabButtonGtk::OnMousePress() {
- if (state_ == BS_HOT) {
- mouse_pressed_ = true;
- state_ = BS_PUSHED;
- return true;
- }
-
- return false;
-}
-
-void TabButtonGtk::OnMouseRelease() {
- mouse_pressed_ = false;
-
- if (state_ == BS_PUSHED) {
- delegate_->OnButtonActivate(this);
-
- // Jiggle the mouse so we re-highlight the Tab button.
- HighlightTabButton();
- }
-
- state_ = BS_NORMAL;
-}
-
-bool TabButtonGtk::OnLeaveNotify() {
- bool paint = (state_ != BS_NORMAL);
- state_ = BS_NORMAL;
- return paint;
-}
-
-void TabButtonGtk::Paint(ChromeCanvasPaint* canvas) {
- canvas->DrawBitmapInt(images_[state_], bounds_.x(), bounds_.y());
-}
-
-void TabButtonGtk::SetImage(ButtonState state, SkBitmap* bitmap) {
- images_[state] = bitmap ? *bitmap : SkBitmap();
-}
-
-void TabButtonGtk::HighlightTabButton() {
- // Get default display and screen.
- GdkDisplay* display = gdk_display_get_default();
- GdkScreen* screen = gdk_display_get_default_screen(display);
-
- // Get cursor position.
- int x, y;
- gdk_display_get_pointer(display, NULL, &x, &y, NULL);
-
- // Reset cusor position.
- gdk_display_warp_pointer(display, screen, x, y);
-}
« no previous file with comments | « chrome/browser/gtk/tabs/tab_button_gtk.h ('k') | chrome/browser/gtk/tabs/tab_strip_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698