| OLD | NEW |
| 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/webui/history_ui.h" | 5 #include "chrome/browser/ui/webui/history_ui.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 Browser* browser = chrome::FindBrowserWithWebContents( | 654 Browser* browser = chrome::FindBrowserWithWebContents( |
| 655 web_ui()->GetWebContents()); | 655 web_ui()->GetWebContents()); |
| 656 chrome::ShowClearBrowsingDataDialog(browser); | 656 chrome::ShowClearBrowsingDataDialog(browser); |
| 657 #endif | 657 #endif |
| 658 } | 658 } |
| 659 | 659 |
| 660 void BrowsingHistoryHandler::HandleRemoveBookmark(const base::ListValue* args) { | 660 void BrowsingHistoryHandler::HandleRemoveBookmark(const base::ListValue* args) { |
| 661 base::string16 url = ExtractStringValue(args); | 661 base::string16 url = ExtractStringValue(args); |
| 662 Profile* profile = Profile::FromWebUI(web_ui()); | 662 Profile* profile = Profile::FromWebUI(web_ui()); |
| 663 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile); | 663 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile); |
| 664 bookmark_utils::RemoveAllBookmarks(model, GURL(url)); | 664 bookmarks::RemoveAllBookmarks(model, GURL(url)); |
| 665 } | 665 } |
| 666 | 666 |
| 667 // static | 667 // static |
| 668 void BrowsingHistoryHandler::MergeDuplicateResults( | 668 void BrowsingHistoryHandler::MergeDuplicateResults( |
| 669 std::vector<BrowsingHistoryHandler::HistoryEntry>* results) { | 669 std::vector<BrowsingHistoryHandler::HistoryEntry>* results) { |
| 670 std::vector<BrowsingHistoryHandler::HistoryEntry> new_results; | 670 std::vector<BrowsingHistoryHandler::HistoryEntry> new_results; |
| 671 // Pre-reserve the size of the new vector. Since we're working with pointers | 671 // Pre-reserve the size of the new vector. Since we're working with pointers |
| 672 // later on not doing this could lead to the vector being resized and to | 672 // later on not doing this could lead to the vector being resized and to |
| 673 // pointers to invalid locations. | 673 // pointers to invalid locations. |
| 674 new_results.reserve(results->size()); | 674 new_results.reserve(results->size()); |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 Profile* profile = Profile::FromWebUI(web_ui); | 1005 Profile* profile = Profile::FromWebUI(web_ui); |
| 1006 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); | 1006 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); |
| 1007 } | 1007 } |
| 1008 | 1008 |
| 1009 // static | 1009 // static |
| 1010 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( | 1010 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( |
| 1011 ui::ScaleFactor scale_factor) { | 1011 ui::ScaleFactor scale_factor) { |
| 1012 return ResourceBundle::GetSharedInstance(). | 1012 return ResourceBundle::GetSharedInstance(). |
| 1013 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); | 1013 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); |
| 1014 } | 1014 } |
| OLD | NEW |