diff options
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r-- | chrome/browser/ui/cocoa/history_menu_bridge.mm | 12 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/tabpose_window.mm | 9 | ||||
-rw-r--r-- | chrome/browser/ui/intents/web_intent_picker_controller.cc | 7 | ||||
-rw-r--r-- | chrome/browser/ui/search_engines/template_url_table_model.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/toolbar/back_forward_menu_model.cc | 5 | ||||
-rw-r--r-- | chrome/browser/ui/webui/chrome_web_ui_factory.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/webui/extension_icon_source.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/webui/favicon_source.cc | 9 | ||||
-rw-r--r-- | chrome/browser/ui/webui/history2_ui.cc | 9 | ||||
-rw-r--r-- | chrome/browser/ui/webui/history_ui.cc | 9 | ||||
-rw-r--r-- | chrome/browser/ui/webui/ntp/app_launcher_handler.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/webui/ntp/favicon_webui_handler.cc | 5 |
12 files changed, 31 insertions, 52 deletions
diff --git a/chrome/browser/ui/cocoa/history_menu_bridge.mm b/chrome/browser/ui/cocoa/history_menu_bridge.mm index 6c54b81..fa68650 100644 --- a/chrome/browser/ui/cocoa/history_menu_bridge.mm +++ b/chrome/browser/ui/cocoa/history_menu_bridge.mm @@ -4,8 +4,7 @@ #include "chrome/browser/ui/cocoa/history_menu_bridge.h" -#include "base/bind.h" -#include "base/bind_helpers.h" +#include "base/callback.h" #include "base/stl_util.h" #include "base/string_number_conversions.h" #include "base/string_util.h" @@ -387,8 +386,7 @@ void HistoryMenuBridge::CreateMenu() { &cancelable_request_consumer_, base::Time::Now() - base::TimeDelta::FromDays(kMostVisitedScope), kMostVisitedCount, - base::Bind(&HistoryMenuBridge::OnVisitedHistoryResults, - base::Unretained(this))); + NewCallback(this, &HistoryMenuBridge::OnVisitedHistoryResults)); } void HistoryMenuBridge::OnVisitedHistoryResults( @@ -446,9 +444,9 @@ HistoryMenuBridge::HistoryItem* HistoryMenuBridge::HistoryItemForTab( void HistoryMenuBridge::GetFaviconForHistoryItem(HistoryItem* item) { FaviconService* service = profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); - FaviconService::Handle handle = service->GetFaviconForURL( - item->url, history::FAVICON, &favicon_consumer_, - base::Bind(&HistoryMenuBridge::GotFaviconData, base::Unretained(this))); + FaviconService::Handle handle = service->GetFaviconForURL(item->url, + history::FAVICON, &favicon_consumer_, + NewCallback(this, &HistoryMenuBridge::GotFaviconData)); favicon_consumer_.SetClientData(service, handle, item); item->icon_handle = handle; item->icon_requested = true; diff --git a/chrome/browser/ui/cocoa/tabpose_window.mm b/chrome/browser/ui/cocoa/tabpose_window.mm index 3a75527..6a07d23 100644 --- a/chrome/browser/ui/cocoa/tabpose_window.mm +++ b/chrome/browser/ui/cocoa/tabpose_window.mm @@ -10,7 +10,7 @@ #include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" -#include "base/memory/weak_ptr.h" +#include "base/memory/scoped_callback_factory.h" #include "base/sys_string_conversions.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/browser_process.h" @@ -136,7 +136,7 @@ namespace tabpose { class ThumbnailLoader : public base::RefCountedThreadSafe<ThumbnailLoader> { public: ThumbnailLoader(gfx::Size size, RenderWidgetHost* rwh, ThumbnailLayer* layer) - : size_(size), rwh_(rwh), layer_(layer), weak_factory_(this) {} + : size_(size), rwh_(rwh), layer_(layer), factory_(this) {} // Starts the fetch. void LoadThumbnail(); @@ -160,7 +160,7 @@ class ThumbnailLoader : public base::RefCountedThreadSafe<ThumbnailLoader> { gfx::Size size_; RenderWidgetHost* rwh_; // weak ThumbnailLayer* layer_; // weak, owns us - base::WeakPtrFactory<ThumbnailLoader> weak_factory_; + base::ScopedCallbackFactory<ThumbnailLoader> factory_; DISALLOW_COPY_AND_ASSIGN(ThumbnailLoader); }; @@ -185,8 +185,7 @@ void ThumbnailLoader::LoadThumbnail() { generator->AskForSnapshot( rwh_, /*prefer_backing_store=*/false, - base::Bind(&ThumbnailLoader::DidReceiveBitmap, - weak_factory_.GetWeakPtr()), + factory_.NewCallback(&ThumbnailLoader::DidReceiveBitmap), page_size, pixel_size); } diff --git a/chrome/browser/ui/intents/web_intent_picker_controller.cc b/chrome/browser/ui/intents/web_intent_picker_controller.cc index dc89ccf..cbc02ce 100644 --- a/chrome/browser/ui/intents/web_intent_picker_controller.cc +++ b/chrome/browser/ui/intents/web_intent_picker_controller.cc @@ -6,8 +6,6 @@ #include <vector> -#include "base/bind.h" -#include "base/bind_helpers.h" #include "chrome/browser/favicon/favicon_service.h" #include "chrome/browser/intents/web_intents_registry.h" #include "chrome/browser/intents/web_intents_registry_factory.h" @@ -261,9 +259,8 @@ void WebIntentPickerController::FaviconFetcher::Fetch( urls[index], history::FAVICON, &load_consumer_, - base::Bind( - &WebIntentPickerController::FaviconFetcher::OnFaviconDataAvailable, - base::Unretained(this))); + NewCallback(this, &WebIntentPickerController::FaviconFetcher:: + OnFaviconDataAvailable)); load_consumer_.SetClientData(favicon_service_, handle, index); } } diff --git a/chrome/browser/ui/search_engines/template_url_table_model.cc b/chrome/browser/ui/search_engines/template_url_table_model.cc index 30151c9..df098cd 100644 --- a/chrome/browser/ui/search_engines/template_url_table_model.cc +++ b/chrome/browser/ui/search_engines/template_url_table_model.cc @@ -4,8 +4,7 @@ #include "chrome/browser/ui/search_engines/template_url_table_model.h" -#include "base/bind.h" -#include "base/bind_helpers.h" +#include "base/callback.h" #include "base/i18n/rtl.h" #include "base/stl_util.h" #include "base/utf_string_conversions.h" @@ -93,8 +92,7 @@ class ModelEntry { load_state_ = LOADING; favicon_service->GetFavicon(favicon_url, history::FAVICON, &request_consumer_, - base::Bind(&ModelEntry::OnFaviconDataAvailable, - base::Unretained(this))); + NewCallback(this, &ModelEntry::OnFaviconDataAvailable)); } void OnFaviconDataAvailable( diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc index c9a9f7e..b634544 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc @@ -6,8 +6,6 @@ #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" -#include "base/bind.h" -#include "base/bind_helpers.h" #include "base/string_number_conversions.h" #include "chrome/browser/event_disposition.h" #include "chrome/browser/prefs/pref_service.h" @@ -233,8 +231,7 @@ void BackForwardMenuModel::FetchFavicon(NavigationEntry* entry) { return; FaviconService::Handle handle = favicon_service->GetFaviconForURL( entry->url(), history::FAVICON, &load_consumer_, - base::Bind(&BackForwardMenuModel::OnFavIconDataAvailable, - base::Unretained(this))); + NewCallback(this, &BackForwardMenuModel::OnFavIconDataAvailable)); load_consumer_.SetClientData(favicon_service, handle, entry->unique_id()); } diff --git a/chrome/browser/ui/webui/chrome_web_ui_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_factory.cc index bcf2008..09f06cb 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_factory.cc @@ -340,7 +340,9 @@ void ChromeWebUIFactory::GetFaviconForURL( favicon.known_icon = favicon.image_data.get() != NULL && favicon.image_data->size() > 0; favicon.icon_type = history::FAVICON; - request->ForwardResultAsync(request->handle(), favicon); + request->ForwardResultAsync( + FaviconService::FaviconDataCallback::TupleType(request->handle(), + favicon)); } } diff --git a/chrome/browser/ui/webui/extension_icon_source.cc b/chrome/browser/ui/webui/extension_icon_source.cc index 81b0c833..f896457 100644 --- a/chrome/browser/ui/webui/extension_icon_source.cc +++ b/chrome/browser/ui/webui/extension_icon_source.cc @@ -4,8 +4,7 @@ #include "chrome/browser/ui/webui/extension_icon_source.h" -#include "base/bind.h" -#include "base/bind_helpers.h" +#include "base/callback.h" #include "base/memory/ref_counted_memory.h" #include "base/stl_util.h" #include "base/string_number_conversions.h" @@ -242,8 +241,7 @@ void ExtensionIconSource::LoadFaviconImage(int request_id) { favicon_url, history::FAVICON, &cancelable_consumer_, - base::Bind(&ExtensionIconSource::OnFaviconDataAvailable, - base::Unretained(this))); + NewCallback(this, &ExtensionIconSource::OnFaviconDataAvailable)); cancelable_consumer_.SetClientData(favicon_service, handle, request_id); } diff --git a/chrome/browser/ui/webui/favicon_source.cc b/chrome/browser/ui/webui/favicon_source.cc index 480c2f5..7b66fb7 100644 --- a/chrome/browser/ui/webui/favicon_source.cc +++ b/chrome/browser/ui/webui/favicon_source.cc @@ -4,8 +4,7 @@ #include "chrome/browser/ui/webui/favicon_source.h" -#include "base/bind.h" -#include "base/bind_helpers.h" +#include "base/callback.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/url_constants.h" #include "grit/ui_resources.h" @@ -42,8 +41,7 @@ void FaviconSource::StartDataRequest(const std::string& path, GURL(path.substr(8)), history::FAVICON, &cancelable_consumer_, - base::Bind(&FaviconSource::OnFaviconDataAvailable, - base::Unretained(this))); + NewCallback(this, &FaviconSource::OnFaviconDataAvailable)); } else { GURL url; @@ -65,8 +63,7 @@ void FaviconSource::StartDataRequest(const std::string& path, url, icon_types_, &cancelable_consumer_, - base::Bind(&FaviconSource::OnFaviconDataAvailable, - base::Unretained(this))); + NewCallback(this, &FaviconSource::OnFaviconDataAvailable)); } // Attach the ChromeURLDataManager request ID to the history request. cancelable_consumer_.SetClientData(favicon_service, handle, request_id); diff --git a/chrome/browser/ui/webui/history2_ui.cc b/chrome/browser/ui/webui/history2_ui.cc index 48cb4fa..7b80a82 100644 --- a/chrome/browser/ui/webui/history2_ui.cc +++ b/chrome/browser/ui/webui/history2_ui.cc @@ -150,8 +150,7 @@ void BrowsingHistoryHandler2::HandleGetHistory(const ListValue* args) { hs->QueryHistory(search_text_, options, &cancelable_search_consumer_, - base::Bind(&BrowsingHistoryHandler2::QueryComplete, - base::Unretained(this))); + NewCallback(this, &BrowsingHistoryHandler2::QueryComplete)); } void BrowsingHistoryHandler2::HandleSearchHistory(const ListValue* args) { @@ -176,8 +175,7 @@ void BrowsingHistoryHandler2::HandleSearchHistory(const ListValue* args) { hs->QueryHistory(search_text_, options, &cancelable_search_consumer_, - base::Bind(&BrowsingHistoryHandler2::QueryComplete, - base::Unretained(this))); + NewCallback(this, &BrowsingHistoryHandler2::QueryComplete)); } void BrowsingHistoryHandler2::HandleRemoveURLsOnOneDay(const ListValue* args) { @@ -218,8 +216,7 @@ void BrowsingHistoryHandler2::HandleRemoveURLsOnOneDay(const ListValue* args) { Profile::FromWebUI(web_ui_)->GetHistoryService(Profile::EXPLICIT_ACCESS); hs->ExpireHistoryBetween( urls_to_be_deleted_, begin_time, end_time, &cancelable_delete_consumer_, - base::Bind(&BrowsingHistoryHandler2::RemoveComplete, - base::Unretained(this))); + NewCallback(this, &BrowsingHistoryHandler2::RemoveComplete)); } void BrowsingHistoryHandler2::HandleClearBrowsingData(const ListValue* args) { diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc index ba1a648..f88d4db 100644 --- a/chrome/browser/ui/webui/history_ui.cc +++ b/chrome/browser/ui/webui/history_ui.cc @@ -181,8 +181,7 @@ void BrowsingHistoryHandler::HandleGetHistory(const ListValue* args) { hs->QueryHistory(search_text_, options, &cancelable_search_consumer_, - base::Bind(&BrowsingHistoryHandler::QueryComplete, - base::Unretained(this))); + NewCallback(this, &BrowsingHistoryHandler::QueryComplete)); } void BrowsingHistoryHandler::HandleSearchHistory(const ListValue* args) { @@ -207,8 +206,7 @@ void BrowsingHistoryHandler::HandleSearchHistory(const ListValue* args) { hs->QueryHistory(search_text_, options, &cancelable_search_consumer_, - base::Bind(&BrowsingHistoryHandler::QueryComplete, - base::Unretained(this))); + NewCallback(this, &BrowsingHistoryHandler::QueryComplete)); } void BrowsingHistoryHandler::HandleRemoveURLsOnOneDay(const ListValue* args) { @@ -244,8 +242,7 @@ void BrowsingHistoryHandler::HandleRemoveURLsOnOneDay(const ListValue* args) { Profile::FromWebUI(web_ui_)->GetHistoryService(Profile::EXPLICIT_ACCESS); hs->ExpireHistoryBetween( urls, begin_time, end_time, &cancelable_delete_consumer_, - base::Bind(&BrowsingHistoryHandler::RemoveComplete, - base::Unretained(this))); + NewCallback(this, &BrowsingHistoryHandler::RemoveComplete)); } void BrowsingHistoryHandler::HandleClearBrowsingData(const ListValue* args) { diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc index 3651009..111f9a7 100644 --- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc +++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc @@ -792,7 +792,7 @@ void AppLauncherHandler::HandleGenerateAppForLink(const ListValue* args) { FaviconService::Handle h = favicon_service->GetFaviconForURL( launch_url, history::FAVICON, &favicon_consumer_, - base::Bind(&AppLauncherHandler::OnFaviconForApp, base::Unretained(this))); + NewCallback(this, &AppLauncherHandler::OnFaviconForApp)); favicon_consumer_.SetClientData(favicon_service, h, install_info.release()); } diff --git a/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc b/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc index 0ae6443..f4e9688 100644 --- a/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc +++ b/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc @@ -5,7 +5,7 @@ #include "chrome/browser/ui/webui/ntp/favicon_webui_handler.h" #include "base/bind.h" -#include "base/bind_helpers.h" +#include "base/callback_old.h" #include "base/string_split.h" #include "base/string_util.h" #include "base/stringprintf.h" @@ -77,8 +77,7 @@ void FaviconWebUIHandler::HandleGetFaviconDominantColor(const ListValue* args) { GURL(path), history::FAVICON, &consumer_, - base::Bind(&FaviconWebUIHandler::OnFaviconDataAvailable, - base::Unretained(this))); + NewCallback(this, &FaviconWebUIHandler::OnFaviconDataAvailable)); consumer_.SetClientData(favicon_service, handle, id_++); } |