| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 #include "ui/base/resource/resource_bundle.h" | 58 #include "ui/base/resource/resource_bundle.h" |
| 59 | 59 |
| 60 #if defined(ENABLE_MANAGED_USERS) | 60 #if defined(ENABLE_MANAGED_USERS) |
| 61 #include "chrome/browser/managed_mode/managed_mode_navigation_observer.h" | 61 #include "chrome/browser/managed_mode/managed_mode_navigation_observer.h" |
| 62 #include "chrome/browser/managed_mode/managed_mode_url_filter.h" | 62 #include "chrome/browser/managed_mode/managed_mode_url_filter.h" |
| 63 #include "chrome/browser/managed_mode/managed_user_service.h" | 63 #include "chrome/browser/managed_mode/managed_user_service.h" |
| 64 #include "chrome/browser/managed_mode/managed_user_service_factory.h" | 64 #include "chrome/browser/managed_mode/managed_user_service_factory.h" |
| 65 #endif | 65 #endif |
| 66 | 66 |
| 67 #if defined(OS_ANDROID) | 67 #if defined(OS_ANDROID) |
| 68 #include "chrome/browser/ui/android/tab_model/tab_model.h" | 68 #include "chrome/browser/android/chromium_application.h" |
| 69 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" | |
| 70 #endif | 69 #endif |
| 71 | 70 |
| 72 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 71 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 73 #include "chrome/browser/ui/webui/ntp/foreign_session_handler.h" | 72 #include "chrome/browser/ui/webui/ntp/foreign_session_handler.h" |
| 74 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h" | 73 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h" |
| 75 #endif | 74 #endif |
| 76 | 75 |
| 77 static const char kStringsJsFile[] = "strings.js"; | 76 static const char kStringsJsFile[] = "strings.js"; |
| 78 static const char kHistoryJsFile[] = "history.js"; | 77 static const char kHistoryJsFile[] = "history.js"; |
| 79 static const char kOtherDevicesJsFile[] = "other_devices.js"; | 78 static const char kOtherDevicesJsFile[] = "other_devices.js"; |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 for (std::vector<history::ExpireHistoryArgs>::const_iterator it = | 634 for (std::vector<history::ExpireHistoryArgs>::const_iterator it = |
| 636 expire_list.begin(); it != expire_list.end(); ++it) { | 635 expire_list.begin(); it != expire_list.end(); ++it) { |
| 637 activity_log->RemoveURLs(it->urls); | 636 activity_log->RemoveURLs(it->urls); |
| 638 } | 637 } |
| 639 #endif | 638 #endif |
| 640 } | 639 } |
| 641 | 640 |
| 642 void BrowsingHistoryHandler::HandleClearBrowsingData( | 641 void BrowsingHistoryHandler::HandleClearBrowsingData( |
| 643 const base::ListValue* args) { | 642 const base::ListValue* args) { |
| 644 #if defined(OS_ANDROID) | 643 #if defined(OS_ANDROID) |
| 645 const TabModel* tab_model = TabModelList::GetTabModelForWebContents( | 644 chrome::android::ChromiumApplication::OpenClearBrowsingData( |
| 646 web_ui()->GetWebContents()); | 645 web_ui()->GetWebContents()); |
| 647 if (tab_model) | |
| 648 tab_model->OpenClearBrowsingData(); | |
| 649 #else | 646 #else |
| 650 // TODO(beng): This is an improper direct dependency on Browser. Route this | 647 // TODO(beng): This is an improper direct dependency on Browser. Route this |
| 651 // through some sort of delegate. | 648 // through some sort of delegate. |
| 652 Browser* browser = chrome::FindBrowserWithWebContents( | 649 Browser* browser = chrome::FindBrowserWithWebContents( |
| 653 web_ui()->GetWebContents()); | 650 web_ui()->GetWebContents()); |
| 654 chrome::ShowClearBrowsingDataDialog(browser); | 651 chrome::ShowClearBrowsingDataDialog(browser); |
| 655 #endif | 652 #endif |
| 656 } | 653 } |
| 657 | 654 |
| 658 void BrowsingHistoryHandler::HandleRemoveBookmark(const base::ListValue* args) { | 655 void BrowsingHistoryHandler::HandleRemoveBookmark(const base::ListValue* args) { |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 Profile* profile = Profile::FromWebUI(web_ui); | 1001 Profile* profile = Profile::FromWebUI(web_ui); |
| 1005 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); | 1002 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); |
| 1006 } | 1003 } |
| 1007 | 1004 |
| 1008 // static | 1005 // static |
| 1009 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( | 1006 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( |
| 1010 ui::ScaleFactor scale_factor) { | 1007 ui::ScaleFactor scale_factor) { |
| 1011 return ResourceBundle::GetSharedInstance(). | 1008 return ResourceBundle::GetSharedInstance(). |
| 1012 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); | 1009 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); |
| 1013 } | 1010 } |
| OLD | NEW |