OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/browser_window_gtk.h" | 5 #include "chrome/browser/gtk/browser_window_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 | 8 |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/base_paths_linux.h" | 10 #include "base/base_paths_linux.h" |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 MaybeShowBookmarkBar(browser_->GetSelectedTabContents()); | 612 MaybeShowBookmarkBar(browser_->GetSelectedTabContents()); |
613 } else { | 613 } else { |
614 NOTREACHED() << "Got a notification we didn't register for!"; | 614 NOTREACHED() << "Got a notification we didn't register for!"; |
615 } | 615 } |
616 } | 616 } |
617 | 617 |
618 void BrowserWindowGtk::TabDetachedAt(TabContents* contents, int index) { | 618 void BrowserWindowGtk::TabDetachedAt(TabContents* contents, int index) { |
619 // We use index here rather than comparing |contents| because by this time | 619 // We use index here rather than comparing |contents| because by this time |
620 // the model has already removed |contents| from its list, so | 620 // the model has already removed |contents| from its list, so |
621 // browser_->GetSelectedTabContents() will return NULL or something else. | 621 // browser_->GetSelectedTabContents() will return NULL or something else. |
622 if (index == browser_->tabstrip_model()->selected_index()) { | 622 if (index == browser_->tabstrip_model()->selected_index()) |
623 infobar_container_->ChangeTabContents(NULL); | 623 infobar_container_->ChangeTabContents(NULL); |
624 contents_container_->SetTabContents(NULL); | 624 contents_container_->DetachTabContents(contents); |
625 } | |
626 } | 625 } |
627 | 626 |
628 // TODO(estade): this function should probably be unforked from the BrowserView | 627 // TODO(estade): this function should probably be unforked from the BrowserView |
629 // function of the same name by having a shared partial BrowserWindow | 628 // function of the same name by having a shared partial BrowserWindow |
630 // implementation. | 629 // implementation. |
631 void BrowserWindowGtk::TabSelectedAt(TabContents* old_contents, | 630 void BrowserWindowGtk::TabSelectedAt(TabContents* old_contents, |
632 TabContents* new_contents, | 631 TabContents* new_contents, |
633 int index, | 632 int index, |
634 bool user_gesture) { | 633 bool user_gesture) { |
635 DCHECK(old_contents != new_contents); | 634 DCHECK(old_contents != new_contents); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 int command_id = GetCommandId(keyval, modifier); | 790 int command_id = GetCommandId(keyval, modifier); |
792 browser_window->ExecuteBrowserCommand(command_id); | 791 browser_window->ExecuteBrowserCommand(command_id); |
793 | 792 |
794 return TRUE; | 793 return TRUE; |
795 } | 794 } |
796 | 795 |
797 void BrowserWindowGtk::ExecuteBrowserCommand(int id) { | 796 void BrowserWindowGtk::ExecuteBrowserCommand(int id) { |
798 if (browser_->command_updater()->IsCommandEnabled(id)) | 797 if (browser_->command_updater()->IsCommandEnabled(id)) |
799 browser_->ExecuteCommand(id); | 798 browser_->ExecuteCommand(id); |
800 } | 799 } |
OLD | NEW |