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/speech/chrome_speech_recognition_manager_delegate.h" | 5 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, | 183 content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, |
184 content::Source<WebContents>(web_contents)); | 184 content::Source<WebContents>(web_contents)); |
185 registrar_->Add(this, | 185 registrar_->Add(this, |
186 content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, | 186 content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, |
187 content::Source<WebContents>(web_contents)); | 187 content::Source<WebContents>(web_contents)); |
188 } | 188 } |
189 | 189 |
190 // content::NotificationObserver implementation. | 190 // content::NotificationObserver implementation. |
191 virtual void Observe(int type, | 191 virtual void Observe(int type, |
192 const content::NotificationSource& source, | 192 const content::NotificationSource& source, |
193 const content::NotificationDetails& details) OVERRIDE { | 193 const content::NotificationDetails& details) override { |
194 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 194 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
195 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED || | 195 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED || |
196 type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED); | 196 type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED); |
197 | 197 |
198 WebContents* web_contents = content::Source<WebContents>(source).ptr(); | 198 WebContents* web_contents = content::Source<WebContents>(source).ptr(); |
199 std::vector<WebContentsInfo>::iterator iter = FindWebContents(web_contents); | 199 std::vector<WebContentsInfo>::iterator iter = FindWebContents(web_contents); |
200 DCHECK(iter != registered_web_contents_.end()); | 200 DCHECK(iter != registered_web_contents_.end()); |
201 int render_process_id = iter->render_process_id; | 201 int render_process_id = iter->render_process_id; |
202 int render_view_id = iter->render_view_id; | 202 int render_view_id = iter->render_view_id; |
203 registered_web_contents_.erase(iter); | 203 registered_web_contents_.erase(iter); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 // Otherwise this should be a regular tab contents. | 443 // Otherwise this should be a regular tab contents. |
444 allowed = true; | 444 allowed = true; |
445 check_permission = true; | 445 check_permission = true; |
446 #endif | 446 #endif |
447 | 447 |
448 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 448 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
449 base::Bind(callback, check_permission, allowed)); | 449 base::Bind(callback, check_permission, allowed)); |
450 } | 450 } |
451 | 451 |
452 } // namespace speech | 452 } // namespace speech |
OLD | NEW |