| 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/cocoa/web_intent_picker_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/web_intent_picker_cocoa.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 void WebIntentPickerCocoa::OnModelChanged(WebIntentPickerModel* model) { | 115 void WebIntentPickerCocoa::OnModelChanged(WebIntentPickerModel* model) { |
| 116 PerformDelayedLayout(); | 116 PerformDelayedLayout(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void WebIntentPickerCocoa::OnFaviconChanged(WebIntentPickerModel* model, | 119 void WebIntentPickerCocoa::OnFaviconChanged(WebIntentPickerModel* model, |
| 120 size_t index) { | 120 size_t index) { |
| 121 // We don't handle individual icon changes - just redo the whole model. | 121 // We don't handle individual icon changes - just redo the whole model. |
| 122 PerformDelayedLayout(); | 122 PerformDelayedLayout(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void WebIntentPickerCocoa::OnExtensionIconChanged( |
| 126 WebIntentPickerModel* model, |
| 127 const string16& extension_id) { |
| 128 // TODO(binji): implement. |
| 129 } |
| 130 |
| 125 void WebIntentPickerCocoa::OnInlineDisposition(WebIntentPickerModel* model) { | 131 void WebIntentPickerCocoa::OnInlineDisposition(WebIntentPickerModel* model) { |
| 126 const WebIntentPickerModel::InstalledService& installed_service = | 132 const WebIntentPickerModel::InstalledService& installed_service = |
| 127 model->GetInstalledServiceAt(model->inline_disposition_index()); | 133 model->GetInstalledServiceAt(model->inline_disposition_index()); |
| 128 | 134 |
| 129 content::WebContents* web_contents = content::WebContents::Create( | 135 content::WebContents* web_contents = content::WebContents::Create( |
| 130 browser_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); | 136 browser_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); |
| 131 inline_disposition_tab_contents_.reset(new TabContentsWrapper(web_contents)); | 137 inline_disposition_tab_contents_.reset(new TabContentsWrapper(web_contents)); |
| 132 inline_disposition_delegate_.reset(new WebIntentInlineDispositionDelegate); | 138 inline_disposition_delegate_.reset(new WebIntentInlineDispositionDelegate); |
| 133 web_contents->SetDelegate(inline_disposition_delegate_.get()); | 139 web_contents->SetDelegate(inline_disposition_delegate_.get()); |
| 134 | 140 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 160 const WebIntentPickerModel::InstalledService& installed_service = | 166 const WebIntentPickerModel::InstalledService& installed_service = |
| 161 model_->GetInstalledServiceAt(index); | 167 model_->GetInstalledServiceAt(index); |
| 162 service_invoked = true; | 168 service_invoked = true; |
| 163 delegate_->OnServiceChosen(index, installed_service.disposition); | 169 delegate_->OnServiceChosen(index, installed_service.disposition); |
| 164 } | 170 } |
| 165 | 171 |
| 166 void WebIntentPickerCocoa::set_controller( | 172 void WebIntentPickerCocoa::set_controller( |
| 167 WebIntentBubbleController* controller) { | 173 WebIntentBubbleController* controller) { |
| 168 controller_ = controller; | 174 controller_ = controller; |
| 169 } | 175 } |
| OLD | NEW |