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

Side by Side Diff: chrome/browser/ui/intents/web_intent_picker_controller.cc

Issue 9430027: Add default query method to WebIntentsRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix forward decl Created 8 years, 9 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/intents/web_intent_picker_controller.h" 5 #include "chrome/browser/ui/intents/web_intent_picker_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "chrome/browser/ui/browser.h" 11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/favicon/favicon_service.h" 12 #include "chrome/browser/favicon/favicon_service.h"
13 #include "chrome/browser/intents/default_web_intent_service.h"
13 #include "chrome/browser/intents/web_intents_registry_factory.h" 14 #include "chrome/browser/intents/web_intents_registry_factory.h"
14 #include "chrome/browser/intents/cws_intents_registry_factory.h" 15 #include "chrome/browser/intents/cws_intents_registry_factory.h"
15 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/tab_contents/tab_util.h" 17 #include "chrome/browser/tab_contents/tab_util.h"
17 #include "chrome/browser/tabs/tab_strip_model.h" 18 #include "chrome/browser/tabs/tab_strip_model.h"
18 #include "chrome/browser/ui/browser_list.h" 19 #include "chrome/browser/ui/browser_list.h"
19 #include "chrome/browser/ui/browser_navigator.h" 20 #include "chrome/browser/ui/browser_navigator.h"
20 #include "chrome/browser/ui/intents/web_intent_picker.h" 21 #include "chrome/browser/ui/intents/web_intent_picker.h"
21 #include "chrome/browser/ui/intents/web_intent_picker_model.h" 22 #include "chrome/browser/ui/intents/web_intent_picker_model.h"
22 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 23 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 &favicon_consumer_, 283 &favicon_consumer_,
283 base::Bind( 284 base::Bind(
284 &WebIntentPickerController::OnFaviconDataAvailable, 285 &WebIntentPickerController::OnFaviconDataAvailable,
285 weak_ptr_factory_.GetWeakPtr())); 286 weak_ptr_factory_.GetWeakPtr()));
286 favicon_consumer_.SetClientData(favicon_service, handle, i); 287 favicon_consumer_.SetClientData(favicon_service, handle, i);
287 } 288 }
288 289
289 AsyncOperationFinished(); 290 AsyncOperationFinished();
290 } 291 }
291 292
293 void WebIntentPickerController::OnIntentsDefaultsQueryDone(
294 WebIntentsRegistry::QueryID,
295 const DefaultWebIntentService& default_service) {
296 }
297
292 void WebIntentPickerController::OnFaviconDataAvailable( 298 void WebIntentPickerController::OnFaviconDataAvailable(
293 FaviconService::Handle handle, history::FaviconData favicon_data) { 299 FaviconService::Handle handle, history::FaviconData favicon_data) {
294 size_t index = favicon_consumer_.GetClientDataForCurrentRequest(); 300 size_t index = favicon_consumer_.GetClientDataForCurrentRequest();
295 if (favicon_data.is_valid()) { 301 if (favicon_data.is_valid()) {
296 SkBitmap icon_bitmap; 302 SkBitmap icon_bitmap;
297 303
298 if (gfx::PNGCodec::Decode(favicon_data.image_data->front(), 304 if (gfx::PNGCodec::Decode(favicon_data.image_data->front(),
299 favicon_data.image_data->size(), 305 favicon_data.image_data->size(),
300 &icon_bitmap)) { 306 &icon_bitmap)) {
301 gfx::Image icon_image(new SkBitmap(icon_bitmap)); 307 gfx::Image icon_image(new SkBitmap(icon_bitmap));
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 if (--pending_async_count_ == 0) { 432 if (--pending_async_count_ == 0) {
427 picker_->OnPendingAsyncCompleted(); 433 picker_->OnPendingAsyncCompleted();
428 } 434 }
429 } 435 }
430 436
431 void WebIntentPickerController::ClosePicker() { 437 void WebIntentPickerController::ClosePicker() {
432 if (picker_) { 438 if (picker_) {
433 picker_->Close(); 439 picker_->Close();
434 } 440 }
435 } 441 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/intents/web_intent_picker_controller.h ('k') | chrome/browser/ui/intents/web_intents_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698