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

Unified Diff: chrome/browser/dom_ui/most_visited_handler.cc

Issue 441008: Many changes to DictionaryValues:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/dom_ui/most_visited_handler.cc
===================================================================
--- chrome/browser/dom_ui/most_visited_handler.cc (revision 32858)
+++ chrome/browser/dom_ui/most_visited_handler.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -126,7 +126,7 @@
// we'll be filtering-out the returned list with the blacklist URLs.
// We do not subtract the number of pinned URLs we have because the
// HistoryService does not know about those.
- const int result_count = page_count + url_blacklist_->GetSize();
+ const int result_count = page_count + url_blacklist_->size();
HistoryService* hs =
dom_ui_->GetProfile()->GetHistoryService(Profile::EXPLICIT_ACCESS);
// |hs| may be null during unit tests.
@@ -230,13 +230,9 @@
DictionaryValue* new_value = new DictionaryValue();
SetMostVisistedPage(new_value, page);
- bool r = new_value->SetInteger(L"index", index);
- DCHECK(r) << "Failed to set the index for a pinned URL from the NTP Most "
- << "Visited.";
+ new_value->SetInteger(L"index", index);
+ pinned_urls_->Set(GetDictionaryKeyForURL(page.url.spec()), new_value);
- r = pinned_urls_->Set(GetDictionaryKeyForURL(page.url.spec()), new_value);
- DCHECK(r) << "Failed to add pinned URL from the NTP Most Visited.";
-
// TODO(arv): Notify observers?
// Don't call HandleGetMostVisited. Let the client call this as needed.
@@ -276,7 +272,7 @@
for (DictionaryValue::key_iterator it = pinned_urls_->begin_keys();
it != pinned_urls_->end_keys(); ++it) {
Value* value;
- if (pinned_urls_->Get(*it, &value)) {
+ if (pinned_urls_->GetWithoutPathExpansion(*it, &value)) {
if (!value->IsType(DictionaryValue::TYPE_DICTIONARY)) {
NOTREACHED();
return false;

Powered by Google App Engine
This is Rietveld 408576698