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

Side by Side Diff: chrome/browser/extensions/extension_toolbar_model.cc

Issue 8198007: Remove PrefService::ScheduleSavePersistentPrefs and SavePersistentPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos Created 9 years, 2 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/extensions/extension_toolbar_model.h" 5 #include "chrome/browser/extensions/extension_toolbar_model.h"
6 6
7 #include "chrome/browser/extensions/extension_prefs.h" 7 #include "chrome/browser/extensions/extension_prefs.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 FOR_EACH_OBSERVER(Observer, observers_, BrowserActionMoved(extension, index)); 72 FOR_EACH_OBSERVER(Observer, observers_, BrowserActionMoved(extension, index));
73 73
74 UpdatePrefs(); 74 UpdatePrefs();
75 } 75 }
76 76
77 void ExtensionToolbarModel::SetVisibleIconCount(int count) { 77 void ExtensionToolbarModel::SetVisibleIconCount(int count) {
78 visible_icon_count_ = count == static_cast<int>(size()) ? -1 : count; 78 visible_icon_count_ = count == static_cast<int>(size()) ? -1 : count;
79 prefs_->SetInteger(prefs::kExtensionToolbarSize, visible_icon_count_); 79 prefs_->SetInteger(prefs::kExtensionToolbarSize, visible_icon_count_);
80 prefs_->ScheduleSavePersistentPrefs();
81 } 80 }
82 81
83 void ExtensionToolbarModel::Observe(int type, 82 void ExtensionToolbarModel::Observe(int type,
84 const NotificationSource& source, 83 const NotificationSource& source,
85 const NotificationDetails& details) { 84 const NotificationDetails& details) {
86 if (type == chrome::NOTIFICATION_EXTENSIONS_READY) { 85 if (type == chrome::NOTIFICATION_EXTENSIONS_READY) {
87 InitializeExtensionList(); 86 InitializeExtensionList();
88 return; 87 return;
89 } 88 }
90 89
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 int incognito_index = 0, i = 0; 248 int incognito_index = 0, i = 0;
250 for (ExtensionList::iterator iter = begin(); iter != end(); 249 for (ExtensionList::iterator iter = begin(); iter != end();
251 ++iter, ++i) { 250 ++iter, ++i) {
252 if (original_index == i) 251 if (original_index == i)
253 break; 252 break;
254 if (service_->IsIncognitoEnabled((*iter)->id())) 253 if (service_->IsIncognitoEnabled((*iter)->id()))
255 ++incognito_index; 254 ++incognito_index;
256 } 255 }
257 return incognito_index; 256 return incognito_index;
258 } 257 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698