| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/views/tabs/base_tab.h" | 5 #include "chrome/browser/ui/views/tabs/base_tab.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // Explicitly mark midle-mouse clicks as non-handled to ensure the tab | 51 // Explicitly mark midle-mouse clicks as non-handled to ensure the tab |
| 52 // sees them. | 52 // sees them. |
| 53 return event.IsOnlyMiddleMouseButton() ? false : handled; | 53 return event.IsOnlyMiddleMouseButton() ? false : handled; |
| 54 } | 54 } |
| 55 | 55 |
| 56 // We need to let the parent know about mouse state so that it | 56 // We need to let the parent know about mouse state so that it |
| 57 // can highlight itself appropriately. Note that Exit events | 57 // can highlight itself appropriately. Note that Exit events |
| 58 // fire before Enter events, so this works. | 58 // fire before Enter events, so this works. |
| 59 virtual void OnMouseEntered(const views::MouseEvent& event) { | 59 virtual void OnMouseEntered(const views::MouseEvent& event) { |
| 60 CustomButton::OnMouseEntered(event); | 60 CustomButton::OnMouseEntered(event); |
| 61 GetParent()->OnMouseEntered(event); | 61 parent()->OnMouseEntered(event); |
| 62 } | 62 } |
| 63 | 63 |
| 64 virtual void OnMouseExited(const views::MouseEvent& event) { | 64 virtual void OnMouseExited(const views::MouseEvent& event) { |
| 65 CustomButton::OnMouseExited(event); | 65 CustomButton::OnMouseExited(event); |
| 66 GetParent()->OnMouseExited(event); | 66 parent()->OnMouseExited(event); |
| 67 } | 67 } |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 DISALLOW_COPY_AND_ASSIGN(TabCloseButton); | 70 DISALLOW_COPY_AND_ASSIGN(TabCloseButton); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace | 73 } // namespace |
| 74 | 74 |
| 75 // static | 75 // static |
| 76 gfx::Font* BaseTab::font_ = NULL; | 76 gfx::Font* BaseTab::font_ = NULL; |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 // static | 468 // static |
| 469 void BaseTab::InitResources() { | 469 void BaseTab::InitResources() { |
| 470 static bool initialized = false; | 470 static bool initialized = false; |
| 471 if (!initialized) { | 471 if (!initialized) { |
| 472 initialized = true; | 472 initialized = true; |
| 473 font_ = new gfx::Font( | 473 font_ = new gfx::Font( |
| 474 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); | 474 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); |
| 475 font_height_ = font_->GetHeight(); | 475 font_height_ = font_->GetHeight(); |
| 476 } | 476 } |
| 477 } | 477 } |
| OLD | NEW |