| 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/compact_nav/compact_location_bar_view_host.h" | 5 #include "chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.h" |
| 6 | 6 |
| 7 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 void CompactLocationBarViewHost::TabClosingAt(TabStripModel* tab_strip_model, | 296 void CompactLocationBarViewHost::TabClosingAt(TabStripModel* tab_strip_model, |
| 297 TabContentsWrapper* contents, | 297 TabContentsWrapper* contents, |
| 298 int index) { | 298 int index) { |
| 299 // TODO(stevet): We need to relocate the compact navigation bar if the | 299 // TODO(stevet): We need to relocate the compact navigation bar if the |
| 300 // removed tab is not the one we are currently under but the tabstrip does | 300 // removed tab is not the one we are currently under but the tabstrip does |
| 301 // not have the ideal location yet because the tabs are animating at this | 301 // not have the ideal location yet because the tabs are animating at this |
| 302 // time. Need to investigate the best way to handle this case. | 302 // time. Need to investigate the best way to handle this case. |
| 303 Hide(false); | 303 Hide(false); |
| 304 } | 304 } |
| 305 | 305 |
| 306 void CompactLocationBarViewHost::TabSelectedAt(TabContentsWrapper* old_contents, | 306 void CompactLocationBarViewHost::ActiveTabChanged( |
| 307 TabContentsWrapper* new_contents, | 307 TabContentsWrapper* old_contents, |
| 308 int index, | 308 TabContentsWrapper* new_contents, |
| 309 bool user_gesture) { | 309 int index, |
| 310 bool user_gesture) { |
| 310 current_tab_model_index_ = index; | 311 current_tab_model_index_ = index; |
| 311 if (new_contents && new_contents->tab_contents()->is_loading()) { | 312 if (new_contents && new_contents->tab_contents()->is_loading()) { |
| 312 Show(false); | 313 Show(false); |
| 313 } else { | 314 } else { |
| 314 Hide(false); | 315 Hide(false); |
| 315 } | 316 } |
| 316 } | 317 } |
| 317 | 318 |
| 318 void CompactLocationBarViewHost::TabMoved(TabContentsWrapper* contents, | 319 void CompactLocationBarViewHost::TabMoved(TabContentsWrapper* contents, |
| 319 int from_index, | 320 int from_index, |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 bool CompactLocationBarViewHost::IsCurrentTabIndex(int index) { | 509 bool CompactLocationBarViewHost::IsCurrentTabIndex(int index) { |
| 509 return current_tab_model_index_ == index; | 510 return current_tab_model_index_ == index; |
| 510 } | 511 } |
| 511 | 512 |
| 512 bool CompactLocationBarViewHost::IsCurrentTab(TabContents* contents) { | 513 bool CompactLocationBarViewHost::IsCurrentTab(TabContents* contents) { |
| 513 TabStripModel* tab_strip_model = browser_view()->browser()->tabstrip_model(); | 514 TabStripModel* tab_strip_model = browser_view()->browser()->tabstrip_model(); |
| 514 return tab_strip_model->ContainsIndex(current_tab_model_index_) && | 515 return tab_strip_model->ContainsIndex(current_tab_model_index_) && |
| 515 tab_strip_model->GetTabContentsAt(current_tab_model_index_)-> | 516 tab_strip_model->GetTabContentsAt(current_tab_model_index_)-> |
| 516 tab_contents() == contents; | 517 tab_contents() == contents; |
| 517 } | 518 } |
| OLD | NEW |