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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 void BrowsingHistoryHandler::HandleClearBrowsingData(const ListValue* args) { | 273 void BrowsingHistoryHandler::HandleClearBrowsingData(const ListValue* args) { |
274 #if defined(OS_ANDROID) | 274 #if defined(OS_ANDROID) |
275 Profile* profile = Profile::FromWebUI(web_ui()); | 275 Profile* profile = Profile::FromWebUI(web_ui()); |
276 const TabModel* tab_model = | 276 const TabModel* tab_model = |
277 TabModelList::GetTabModelWithProfile(profile); | 277 TabModelList::GetTabModelWithProfile(profile); |
278 if (tab_model) | 278 if (tab_model) |
279 tab_model->OpenClearBrowsingData(); | 279 tab_model->OpenClearBrowsingData(); |
280 #else | 280 #else |
281 // TODO(beng): This is an improper direct dependency on Browser. Route this | 281 // TODO(beng): This is an improper direct dependency on Browser. Route this |
282 // through some sort of delegate. | 282 // through some sort of delegate. |
283 Browser* browser = browser::FindBrowserWithWebContents( | 283 Browser* browser = chrome::FindBrowserWithWebContents( |
284 web_ui()->GetWebContents()); | 284 web_ui()->GetWebContents()); |
285 chrome::ShowClearBrowsingDataDialog(browser); | 285 chrome::ShowClearBrowsingDataDialog(browser); |
286 #endif | 286 #endif |
287 } | 287 } |
288 | 288 |
289 void BrowsingHistoryHandler::HandleRemoveBookmark(const ListValue* args) { | 289 void BrowsingHistoryHandler::HandleRemoveBookmark(const ListValue* args) { |
290 string16 url = ExtractStringValue(args); | 290 string16 url = ExtractStringValue(args); |
291 Profile* profile = Profile::FromWebUI(web_ui()); | 291 Profile* profile = Profile::FromWebUI(web_ui()); |
292 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile); | 292 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile); |
293 bookmark_utils::RemoveAllBookmarks(model, GURL(url)); | 293 bookmark_utils::RemoveAllBookmarks(model, GURL(url)); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + | 452 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + |
453 net::EscapeQueryParamValue(UTF16ToUTF8(text), true)); | 453 net::EscapeQueryParamValue(UTF16ToUTF8(text), true)); |
454 } | 454 } |
455 | 455 |
456 // static | 456 // static |
457 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( | 457 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( |
458 ui::ScaleFactor scale_factor) { | 458 ui::ScaleFactor scale_factor) { |
459 return ResourceBundle::GetSharedInstance(). | 459 return ResourceBundle::GetSharedInstance(). |
460 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); | 460 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); |
461 } | 461 } |
OLD | NEW |