| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 void WebIntentPickerController::OnServiceChosen(size_t index) { | 184 void WebIntentPickerController::OnServiceChosen(size_t index) { |
| 185 DCHECK(index < urls_.size()); | 185 DCHECK(index < urls_.size()); |
| 186 | 186 |
| 187 // TODO(gbillock): This really only handles the 'window' disposition in a | 187 // TODO(gbillock): This really only handles the 'window' disposition in a |
| 188 // quite prototype way. We need to flesh out what happens to the picker during | 188 // quite prototype way. We need to flesh out what happens to the picker during |
| 189 // the lifetime of the service url context, and that may mean we need to pass | 189 // the lifetime of the service url context, and that may mean we need to pass |
| 190 // more information into the injector to find the picker again and close it. | 190 // more information into the injector to find the picker again and close it. |
| 191 browser::NavigateParams params(NULL, urls_[index], | 191 browser::NavigateParams params(NULL, urls_[index], |
| 192 PageTransition::AUTO_BOOKMARK); | 192 content::PAGE_TRANSITION_AUTO_BOOKMARK); |
| 193 params.disposition = NEW_FOREGROUND_TAB; | 193 params.disposition = NEW_FOREGROUND_TAB; |
| 194 params.profile = wrapper_->profile(); | 194 params.profile = wrapper_->profile(); |
| 195 browser::Navigate(¶ms); | 195 browser::Navigate(¶ms); |
| 196 | 196 |
| 197 IntentInjector* injector = new IntentInjector( | 197 IntentInjector* injector = new IntentInjector( |
| 198 params.target_contents->tab_contents()); | 198 params.target_contents->tab_contents()); |
| 199 injector->SetIntent(new InvokingTabReplyForwarder(wrapper_, routing_id_), | 199 injector->SetIntent(new InvokingTabReplyForwarder(wrapper_, routing_id_), |
| 200 intent_, | 200 intent_, |
| 201 intent_id_); | 201 intent_id_); |
| 202 | 202 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 if (gfx::PNGCodec::Decode(favicon_data.image_data->front(), | 308 if (gfx::PNGCodec::Decode(favicon_data.image_data->front(), |
| 309 favicon_data.image_data->size(), | 309 favicon_data.image_data->size(), |
| 310 &icon_bitmap)) { | 310 &icon_bitmap)) { |
| 311 controller_->OnFaviconDataAvailable(index, icon_bitmap); | 311 controller_->OnFaviconDataAvailable(index, icon_bitmap); |
| 312 return; | 312 return; |
| 313 } | 313 } |
| 314 } | 314 } |
| 315 | 315 |
| 316 controller_->OnFaviconDataUnavailable(index); | 316 controller_->OnFaviconDataUnavailable(index); |
| 317 } | 317 } |
| OLD | NEW |