| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <limits> | 5 #include <limits> |
| 6 | 6 |
| 7 #include "chrome/browser/views/tabs/tab_renderer.h" | 7 #include "chrome/browser/views/tabs/tab_renderer.h" |
| 8 | 8 |
| 9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
| 10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // TabCloseButton | 178 // TabCloseButton |
| 179 // | 179 // |
| 180 // This is a Button subclass that causes middle clicks to be forwarded to the | 180 // This is a Button subclass that causes middle clicks to be forwarded to the |
| 181 // parent View by explicitly not handling them in OnMousePressed. | 181 // parent View by explicitly not handling them in OnMousePressed. |
| 182 class TabCloseButton : public views::Button { | 182 class TabCloseButton : public views::Button { |
| 183 public: | 183 public: |
| 184 TabCloseButton() : Button() {} | 184 TabCloseButton() : Button() {} |
| 185 virtual ~TabCloseButton() {} | 185 virtual ~TabCloseButton() {} |
| 186 | 186 |
| 187 virtual bool OnMousePressed(const views::MouseEvent& event) { | 187 virtual bool OnMousePressed(const views::MouseEvent& event) { |
| 188 LOG(WARNING) << "MOUSE PRESSED"; |
| 188 return !event.IsOnlyMiddleMouseButton(); | 189 return !event.IsOnlyMiddleMouseButton(); |
| 189 } | 190 } |
| 190 | 191 |
| 191 // We need to let the parent know about mouse state so that it | 192 // We need to let the parent know about mouse state so that it |
| 192 // can highlight itself appropriately. Note that Exit events | 193 // can highlight itself appropriately. Note that Exit events |
| 193 // fire before Enter events, so this works. | 194 // fire before Enter events, so this works. |
| 194 virtual void OnMouseEntered(const views::MouseEvent& event) { | 195 virtual void OnMouseEntered(const views::MouseEvent& event) { |
| 195 BaseButton::OnMouseEntered(event); | 196 BaseButton::OnMouseEntered(event); |
| 196 GetParent()->OnMouseEntered(event); | 197 GetParent()->OnMouseEntered(event); |
| 197 } | 198 } |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 } | 695 } |
| 695 | 696 |
| 696 void TabRenderer::DisplayCrashedFavIcon() { | 697 void TabRenderer::DisplayCrashedFavIcon() { |
| 697 should_display_crashed_favicon_ = true; | 698 should_display_crashed_favicon_ = true; |
| 698 } | 699 } |
| 699 | 700 |
| 700 void TabRenderer::ResetCrashedFavIcon() { | 701 void TabRenderer::ResetCrashedFavIcon() { |
| 701 should_display_crashed_favicon_ = false; | 702 should_display_crashed_favicon_ = false; |
| 702 } | 703 } |
| 703 | 704 |
| OLD | NEW |