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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 } | 506 } |
507 | 507 |
508 void BaseTab::ButtonPressed(views::Button* sender, const views::Event& event) { | 508 void BaseTab::ButtonPressed(views::Button* sender, const views::Event& event) { |
509 DCHECK(sender == close_button_); | 509 DCHECK(sender == close_button_); |
510 controller()->CloseTab(this); | 510 controller()->CloseTab(this); |
511 } | 511 } |
512 | 512 |
513 void BaseTab::ShowContextMenuForView(views::View* source, | 513 void BaseTab::ShowContextMenuForView(views::View* source, |
514 const gfx::Point& p, | 514 const gfx::Point& p, |
515 bool is_mouse_gesture) { | 515 bool is_mouse_gesture) { |
516 if (controller()) | 516 if (controller() && !closing()) |
517 controller()->ShowContextMenuForTab(this, p); | 517 controller()->ShowContextMenuForTab(this, p); |
518 } | 518 } |
519 | 519 |
520 int BaseTab::loading_animation_frame() const { | 520 int BaseTab::loading_animation_frame() const { |
521 return loading_animation_frame_; | 521 return loading_animation_frame_; |
522 } | 522 } |
523 | 523 |
524 bool BaseTab::should_display_crashed_favicon() const { | 524 bool BaseTab::should_display_crashed_favicon() const { |
525 return should_display_crashed_favicon_; | 525 return should_display_crashed_favicon_; |
526 } | 526 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 // static | 575 // static |
576 void BaseTab::InitResources() { | 576 void BaseTab::InitResources() { |
577 static bool initialized = false; | 577 static bool initialized = false; |
578 if (!initialized) { | 578 if (!initialized) { |
579 initialized = true; | 579 initialized = true; |
580 font_ = new gfx::Font( | 580 font_ = new gfx::Font( |
581 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); | 581 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); |
582 font_height_ = font_->GetHeight(); | 582 font_height_ = font_->GetHeight(); |
583 } | 583 } |
584 } | 584 } |
OLD | NEW |