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

Side by Side Diff: chrome/browser/ui/views/browser_actions_container.cc

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Really fix. And rebase Created 9 years, 7 months 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) 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/browser_actions_container.h" 5 #include "chrome/browser/ui/views/browser_actions_container.h"
6 6
7 #include "base/stl_util-inl.h" 7 #include "base/stl_util-inl.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/extensions/extension_browser_event_router.h" 10 #include "chrome/browser/extensions/extension_browser_event_router.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 BrowserActionsContainer::~BrowserActionsContainer() { 384 BrowserActionsContainer::~BrowserActionsContainer() {
385 if (model_) 385 if (model_)
386 model_->RemoveObserver(this); 386 model_->RemoveObserver(this);
387 StopShowFolderDropMenuTimer(); 387 StopShowFolderDropMenuTimer();
388 HidePopup(); 388 HidePopup();
389 DeleteBrowserActionViews(); 389 DeleteBrowserActionViews();
390 } 390 }
391 391
392 // Static. 392 // Static.
393 void BrowserActionsContainer::RegisterUserPrefs(PrefService* prefs) { 393 void BrowserActionsContainer::RegisterUserPrefs(PrefService* prefs) {
394 prefs->RegisterIntegerPref(prefs::kBrowserActionContainerWidth, 0); 394 prefs->RegisterIntegerPref(prefs::kBrowserActionContainerWidth,
395 0,
396 PrefService::UNSYNCABLE_PREF);
395 } 397 }
396 398
397 void BrowserActionsContainer::Init() { 399 void BrowserActionsContainer::Init() {
398 LoadImages(); 400 LoadImages();
399 401
400 // We wait to set the container width until now so that the chevron images 402 // We wait to set the container width until now so that the chevron images
401 // will be loaded. The width calculation needs to know the chevron size. 403 // will be loaded. The width calculation needs to know the chevron size.
402 if (model_ && 404 if (model_ &&
403 !profile_->GetPrefs()->HasPrefPath(prefs::kExtensionToolbarSize)) { 405 !profile_->GetPrefs()->HasPrefPath(prefs::kExtensionToolbarSize)) {
404 // Migration code to the new VisibleIconCount pref. 406 // Migration code to the new VisibleIconCount pref.
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 } 1095 }
1094 } 1096 }
1095 1097
1096 bool BrowserActionsContainer::ShouldDisplayBrowserAction( 1098 bool BrowserActionsContainer::ShouldDisplayBrowserAction(
1097 const Extension* extension) { 1099 const Extension* extension) {
1098 // Only display incognito-enabled extensions while in incognito mode. 1100 // Only display incognito-enabled extensions while in incognito mode.
1099 return 1101 return
1100 (!profile_->IsOffTheRecord() || 1102 (!profile_->IsOffTheRecord() ||
1101 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); 1103 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id()));
1102 } 1104 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tab_contents/tab_contents_wrapper.cc ('k') | chrome/browser/ui/webui/ntp/most_visited_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698