summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/tabs/base_tab.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-27 14:54:15 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-27 14:54:15 +0000
commitb68becccf8fd9deb39346f1d36413817ab924e78 (patch)
tree0fa25577bf4034d9e5e380fdfb9f0b7a9d82d564 /chrome/browser/views/tabs/base_tab.cc
parent539d8f80f984dfed455b40533df0ad5d15e2c2ba (diff)
downloadchromium_src-b68becccf8fd9deb39346f1d36413817ab924e78.zip
chromium_src-b68becccf8fd9deb39346f1d36413817ab924e78.tar.gz
chromium_src-b68becccf8fd9deb39346f1d36413817ab924e78.tar.bz2
Adds the new tab button to side tabs.
BUG=none TEST=none Review URL: http://codereview.chromium.org/2224003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tabs/base_tab.cc')
-rw-r--r--chrome/browser/views/tabs/base_tab.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/chrome/browser/views/tabs/base_tab.cc b/chrome/browser/views/tabs/base_tab.cc
index 070e1ee..f128abc 100644
--- a/chrome/browser/views/tabs/base_tab.cc
+++ b/chrome/browser/views/tabs/base_tab.cc
@@ -248,6 +248,9 @@ void BaseTab::OnMouseExited(const views::MouseEvent& e) {
}
bool BaseTab::OnMousePressed(const views::MouseEvent& event) {
+ if (!controller())
+ return false;
+
if (event.IsOnlyLeftMouseButton()) {
// Store whether or not we were selected just now... we only want to be
// able to drag foreground tabs, so we don't start dragging the tab if
@@ -261,11 +264,15 @@ bool BaseTab::OnMousePressed(const views::MouseEvent& event) {
}
bool BaseTab::OnMouseDragged(const views::MouseEvent& event) {
- controller()->ContinueDrag(event);
+ if (controller())
+ controller()->ContinueDrag(event);
return true;
}
void BaseTab::OnMouseReleased(const views::MouseEvent& event, bool canceled) {
+ if (!controller())
+ return;
+
// Notify the drag helper that we're done with any potential drag operations.
// Clean up the drag helper, which is re-created on the next mouse press.
// In some cases, ending the drag will schedule the tab for destruction; if
@@ -413,7 +420,8 @@ void BaseTab::ButtonPressed(views::Button* sender, const views::Event& event) {
void BaseTab::ShowContextMenu(views::View* source,
const gfx::Point& p,
bool is_mouse_gesture) {
- controller()->ShowContextMenu(this, p);
+ if (controller())
+ controller()->ShowContextMenu(this, p);
}
void BaseTab::ThemeChanged() {