OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/tabs/browser_tab_strip_controller.h" | 5 #include "chrome/browser/views/tabs/browser_tab_strip_controller.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 TabChangeType change_type) { | 331 TabChangeType change_type) { |
332 if (change_type == TITLE_NOT_LOADING) { | 332 if (change_type == TITLE_NOT_LOADING) { |
333 tabstrip_->TabTitleChangedNotLoading(model_index); | 333 tabstrip_->TabTitleChangedNotLoading(model_index); |
334 // We'll receive another notification of the change asynchronously. | 334 // We'll receive another notification of the change asynchronously. |
335 return; | 335 return; |
336 } | 336 } |
337 | 337 |
338 SetTabDataAt(contents, model_index); | 338 SetTabDataAt(contents, model_index); |
339 } | 339 } |
340 | 340 |
341 void BrowserTabStripController::TabReplacedAt(TabContents* old_contents, | |
342 TabContents* new_contents, | |
343 int model_index) { | |
344 SetTabDataAt(new_contents, model_index); | |
345 } | |
346 | |
347 void BrowserTabStripController::TabPinnedStateChanged(TabContents* contents, | 341 void BrowserTabStripController::TabPinnedStateChanged(TabContents* contents, |
348 int model_index) { | 342 int model_index) { |
349 // Currently none of the renderers render pinned state differently. | 343 // Currently none of the renderers render pinned state differently. |
350 } | 344 } |
351 | 345 |
352 void BrowserTabStripController::TabMiniStateChanged( | 346 void BrowserTabStripController::TabMiniStateChanged( |
353 TabContents* contents, | 347 TabContents* contents, |
354 int model_index) { | 348 int model_index) { |
355 SetTabDataAt(contents, model_index); | 349 SetTabDataAt(contents, model_index); |
356 } | 350 } |
(...skipping 20 matching lines...) Expand all Loading... |
377 else | 371 else |
378 data->favicon = contents->GetFavIcon(); | 372 data->favicon = contents->GetFavIcon(); |
379 data->network_state = TabContentsNetworkState(contents); | 373 data->network_state = TabContentsNetworkState(contents); |
380 data->title = contents->GetTitle(); | 374 data->title = contents->GetTitle(); |
381 data->loading = contents->is_loading(); | 375 data->loading = contents->is_loading(); |
382 data->crashed = contents->is_crashed(); | 376 data->crashed = contents->is_crashed(); |
383 data->off_the_record = contents->profile()->IsOffTheRecord(); | 377 data->off_the_record = contents->profile()->IsOffTheRecord(); |
384 data->show_icon = contents->ShouldDisplayFavIcon(); | 378 data->show_icon = contents->ShouldDisplayFavIcon(); |
385 data->mini = model_->IsMiniTab(model_index); | 379 data->mini = model_->IsMiniTab(model_index); |
386 data->blocked = model_->IsTabBlocked(model_index); | 380 data->blocked = model_->IsTabBlocked(model_index); |
387 data->phantom = model_->IsPhantomTab(model_index); | |
388 data->app = contents->is_app(); | 381 data->app = contents->is_app(); |
389 } | 382 } |
390 | 383 |
391 void BrowserTabStripController::StartHighlightTabsForCommand( | 384 void BrowserTabStripController::StartHighlightTabsForCommand( |
392 TabStripModel::ContextMenuCommand command_id, | 385 TabStripModel::ContextMenuCommand command_id, |
393 BaseTab* tab) { | 386 BaseTab* tab) { |
394 if (command_id == TabStripModel::CommandCloseTabsOpenedBy || | 387 if (command_id == TabStripModel::CommandCloseTabsOpenedBy || |
395 command_id == TabStripModel::CommandCloseOtherTabs || | 388 command_id == TabStripModel::CommandCloseOtherTabs || |
396 command_id == TabStripModel::CommandCloseTabsToRight) { | 389 command_id == TabStripModel::CommandCloseTabsToRight) { |
397 int model_index = tabstrip_->GetModelIndexOfBaseTab(tab); | 390 int model_index = tabstrip_->GetModelIndexOfBaseTab(tab); |
(...skipping 11 matching lines...) Expand all Loading... |
409 void BrowserTabStripController::StopHighlightTabsForCommand( | 402 void BrowserTabStripController::StopHighlightTabsForCommand( |
410 TabStripModel::ContextMenuCommand command_id, | 403 TabStripModel::ContextMenuCommand command_id, |
411 BaseTab* tab) { | 404 BaseTab* tab) { |
412 if (command_id == TabStripModel::CommandCloseTabsOpenedBy || | 405 if (command_id == TabStripModel::CommandCloseTabsOpenedBy || |
413 command_id == TabStripModel::CommandCloseTabsToRight || | 406 command_id == TabStripModel::CommandCloseTabsToRight || |
414 command_id == TabStripModel::CommandCloseOtherTabs) { | 407 command_id == TabStripModel::CommandCloseOtherTabs) { |
415 // Just tell all Tabs to stop pulsing - it's safe. | 408 // Just tell all Tabs to stop pulsing - it's safe. |
416 tabstrip_->StopAllHighlighting(); | 409 tabstrip_->StopAllHighlighting(); |
417 } | 410 } |
418 } | 411 } |
OLD | NEW |