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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 weak_ptr_factory_.GetWeakPtr())); | 116 weak_ptr_factory_.GetWeakPtr())); |
117 } | 117 } |
118 | 118 |
119 void WebIntentPickerController::ShowDialog(Browser* browser, | 119 void WebIntentPickerController::ShowDialog(Browser* browser, |
120 const string16& action, | 120 const string16& action, |
121 const string16& type) { | 121 const string16& type) { |
122 // Only show a picker once. | 122 // Only show a picker once. |
123 if (picker_shown_) | 123 if (picker_shown_) |
124 return; | 124 return; |
125 | 125 |
126 // TODO(binji): Remove this check when we decide how to allow intent | |
127 // invocation in incognito mode. | |
128 if (wrapper_->profile()->IsOffTheRecord()) | |
groby-ooo-7-16
2012/03/22 00:20:24
We probably need to do more than just remove that
binji
2012/03/22 00:38:40
Done.
| |
129 return; | |
130 | |
126 picker_model_->Clear(); | 131 picker_model_->Clear(); |
127 | 132 |
128 // If picker is non-NULL, it was set by a test. | 133 // If picker is non-NULL, it was set by a test. |
129 if (picker_ == NULL) { | 134 if (picker_ == NULL) { |
130 picker_ = WebIntentPicker::Create(browser, wrapper_, this, | 135 picker_ = WebIntentPicker::Create(browser, wrapper_, this, |
131 picker_model_.get()); | 136 picker_model_.get()); |
132 } | 137 } |
133 | 138 |
134 picker_shown_ = true; | 139 picker_shown_ = true; |
135 pending_async_count_+= 2; | 140 pending_async_count_+= 2; |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
421 if (--pending_async_count_ == 0) { | 426 if (--pending_async_count_ == 0) { |
422 picker_->OnPendingAsyncCompleted(); | 427 picker_->OnPendingAsyncCompleted(); |
423 } | 428 } |
424 } | 429 } |
425 | 430 |
426 void WebIntentPickerController::ClosePicker() { | 431 void WebIntentPickerController::ClosePicker() { |
427 if (picker_) { | 432 if (picker_) { |
428 picker_->Close(); | 433 picker_->Close(); |
429 } | 434 } |
430 } | 435 } |
OLD | NEW |