| 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/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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 ASCIIToUTF16("Simultaneous intent invocation.")); | 176 ASCIIToUTF16("Simultaneous intent invocation.")); |
| 177 } | 177 } |
| 178 return; | 178 return; |
| 179 } | 179 } |
| 180 | 180 |
| 181 // TODO(binji): Figure out what to do when intents are invoked from incognito | 181 // TODO(binji): Figure out what to do when intents are invoked from incognito |
| 182 // mode. | 182 // mode. |
| 183 if (wrapper_->profile()->IsOffTheRecord()) { | 183 if (wrapper_->profile()->IsOffTheRecord()) { |
| 184 if (intents_dispatcher_) { | 184 if (intents_dispatcher_) { |
| 185 intents_dispatcher_->SendReplyMessage( | 185 intents_dispatcher_->SendReplyMessage( |
| 186 webkit_glue::WEB_INTENT_REPLY_FAILURE, ASCIIToUTF16("")); | 186 webkit_glue::WEB_INTENT_REPLY_FAILURE, string16()); |
| 187 } | 187 } |
| 188 return; | 188 return; |
| 189 } | 189 } |
| 190 | 190 |
| 191 picker_model_->Clear(); | 191 picker_model_->Clear(); |
| 192 picker_model_->set_action(action); | 192 picker_model_->set_action(action); |
| 193 picker_model_->set_mimetype(type); | 193 picker_model_->set_mimetype(type); |
| 194 | 194 |
| 195 // If the intent is explicit, skip showing the picker. | 195 // If the intent is explicit, skip showing the picker. |
| 196 if (intents_dispatcher_) { | 196 if (intents_dispatcher_) { |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 // If picker is non-NULL, it was set by a test. | 657 // If picker is non-NULL, it was set by a test. |
| 658 if (picker_ == NULL) | 658 if (picker_ == NULL) |
| 659 picker_ = WebIntentPicker::Create(wrapper_, this, picker_model_.get()); | 659 picker_ = WebIntentPicker::Create(wrapper_, this, picker_model_.get()); |
| 660 picker_shown_ = true; | 660 picker_shown_ = true; |
| 661 } | 661 } |
| 662 | 662 |
| 663 void WebIntentPickerController::ClosePicker() { | 663 void WebIntentPickerController::ClosePicker() { |
| 664 if (picker_) | 664 if (picker_) |
| 665 picker_->Close(); | 665 picker_->Close(); |
| 666 } | 666 } |
| OLD | NEW |