| 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 } | 416 } |
| 417 | 417 |
| 418 #if defined(ENABLE_EXTENSIONS) | 418 #if defined(ENABLE_EXTENSIONS) |
| 419 WebContents* web_contents = WebContents::FromRenderViewHost(render_view_host); | 419 WebContents* web_contents = WebContents::FromRenderViewHost(render_view_host); |
| 420 extensions::ViewType view_type = extensions::GetViewType(web_contents); | 420 extensions::ViewType view_type = extensions::GetViewType(web_contents); |
| 421 | 421 |
| 422 if (view_type == extensions::VIEW_TYPE_TAB_CONTENTS || | 422 if (view_type == extensions::VIEW_TYPE_TAB_CONTENTS || |
| 423 view_type == extensions::VIEW_TYPE_APP_WINDOW || | 423 view_type == extensions::VIEW_TYPE_APP_WINDOW || |
| 424 view_type == extensions::VIEW_TYPE_LAUNCHER_PAGE || | 424 view_type == extensions::VIEW_TYPE_LAUNCHER_PAGE || |
| 425 view_type == extensions::VIEW_TYPE_VIRTUAL_KEYBOARD || | 425 view_type == extensions::VIEW_TYPE_VIRTUAL_KEYBOARD || |
| 426 view_type == extensions::VIEW_TYPE_EXTENSION_POPUP || |
| 426 view_type == extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) { | 427 view_type == extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) { |
| 427 // If it is a tab, we can check for permission. For apps, this means | 428 // If it is a tab, we can check for permission. For apps, this means |
| 428 // manifest would be checked for permission. | 429 // manifest would be checked for permission. |
| 429 allowed = true; | 430 allowed = true; |
| 430 check_permission = true; | 431 check_permission = true; |
| 431 } | 432 } |
| 432 #else | 433 #else |
| 433 // Otherwise this should be a regular tab contents. | 434 // Otherwise this should be a regular tab contents. |
| 434 allowed = true; | 435 allowed = true; |
| 435 check_permission = true; | 436 check_permission = true; |
| 436 #endif | 437 #endif |
| 437 | 438 |
| 438 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 439 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 439 base::Bind(callback, check_permission, allowed)); | 440 base::Bind(callback, check_permission, allowed)); |
| 440 } | 441 } |
| 441 | 442 |
| 442 } // namespace speech | 443 } // namespace speech |
| OLD | NEW |