Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser_tab_strip_controller.h" 5 #include "chrome/browser/ui/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_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/extensions/tab_helper.h" 10 #include "chrome/browser/extensions/tab_helper.h"
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 } 435 }
436 436
437 void BrowserTabStripController::TabBlockedStateChanged(TabContents* contents, 437 void BrowserTabStripController::TabBlockedStateChanged(TabContents* contents,
438 int model_index) { 438 int model_index) {
439 SetTabDataAt(contents->web_contents(), model_index); 439 SetTabDataAt(contents->web_contents(), model_index);
440 } 440 }
441 441
442 //////////////////////////////////////////////////////////////////////////////// 442 ////////////////////////////////////////////////////////////////////////////////
443 // BrowserTabStripController, content::NotificationObserver implementation: 443 // BrowserTabStripController, content::NotificationObserver implementation:
444 444
445 void BrowserTabStripController::Observe(int type, 445 void BrowserTabStripController::OnPreferenceChanged(
446 const content::NotificationSource& source, 446 PrefServiceBase* service,
447 const content::NotificationDetails& details) { 447 const std::string& pref_name) {
448 switch (type) { 448 if (pref_name == prefs::kTabStripLayoutType) {
449 case chrome::NOTIFICATION_PREF_CHANGED: 449 UpdateLayoutType();
450 if (*content::Details<std::string>(details).ptr() ==
451 prefs::kTabStripLayoutType) {
452 UpdateLayoutType();
453 }
454 break;
455
456 default:
457 NOTREACHED();
458 break;
459 } 450 }
460 } 451 }
461 452
462 void BrowserTabStripController::SetTabRendererDataFromModel( 453 void BrowserTabStripController::SetTabRendererDataFromModel(
463 WebContents* contents, 454 WebContents* contents,
464 int model_index, 455 int model_index,
465 TabRendererData* data, 456 TabRendererData* data,
466 TabStatus tab_status) { 457 TabStatus tab_status) {
467 FaviconTabHelper* favicon_tab_helper = 458 FaviconTabHelper* favicon_tab_helper =
468 FaviconTabHelper::FromWebContents(contents); 459 FaviconTabHelper::FromWebContents(contents);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 SetTabRendererDataFromModel(contents->web_contents(), index, &data, NEW_TAB); 521 SetTabRendererDataFromModel(contents->web_contents(), index, &data, NEW_TAB);
531 tabstrip_->AddTabAt(index, data, is_active); 522 tabstrip_->AddTabAt(index, data, is_active);
532 } 523 }
533 524
534 void BrowserTabStripController::UpdateLayoutType() { 525 void BrowserTabStripController::UpdateLayoutType() {
535 bool adjust_layout = false; 526 bool adjust_layout = false;
536 TabStripLayoutType layout_type = 527 TabStripLayoutType layout_type =
537 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout); 528 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout);
538 tabstrip_->SetLayoutType(layout_type, adjust_layout); 529 tabstrip_->SetLayoutType(layout_type, adjust_layout);
539 } 530 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/browser_tab_strip_controller.h ('k') | chrome/browser/ui/views/toolbar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698