Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc

Issue 2479593006: Move enable extensions define to a build flag. (Closed)
Patch Set: Merge Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/site_details.cc ('k') | chrome/browser/ssl/ssl_blocking_page.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 12 matching lines...) Expand all
23 #include "content/public/browser/render_process_host.h" 23 #include "content/public/browser/render_process_host.h"
24 #include "content/public/browser/render_view_host.h" 24 #include "content/public/browser/render_view_host.h"
25 #include "content/public/browser/resource_context.h" 25 #include "content/public/browser/resource_context.h"
26 #include "content/public/browser/speech_recognition_manager.h" 26 #include "content/public/browser/speech_recognition_manager.h"
27 #include "content/public/browser/speech_recognition_session_config.h" 27 #include "content/public/browser/speech_recognition_session_config.h"
28 #include "content/public/browser/speech_recognition_session_context.h" 28 #include "content/public/browser/speech_recognition_session_context.h"
29 #include "content/public/browser/web_contents.h" 29 #include "content/public/browser/web_contents.h"
30 #include "content/public/browser/web_contents_observer.h" 30 #include "content/public/browser/web_contents_observer.h"
31 #include "content/public/common/speech_recognition_error.h" 31 #include "content/public/common/speech_recognition_error.h"
32 #include "content/public/common/speech_recognition_result.h" 32 #include "content/public/common/speech_recognition_result.h"
33 #include "extensions/features/features.h"
33 #include "net/url_request/url_request_context_getter.h" 34 #include "net/url_request/url_request_context_getter.h"
34 35
35 #if defined(OS_WIN) 36 #if defined(OS_WIN)
36 #include "chrome/installer/util/wmi.h" 37 #include "chrome/installer/util/wmi.h"
37 #endif 38 #endif
38 39
39 #if defined(ENABLE_EXTENSIONS) 40 #if BUILDFLAG(ENABLE_EXTENSIONS)
40 #include "chrome/browser/extensions/extension_service.h" 41 #include "chrome/browser/extensions/extension_service.h"
41 #include "extensions/browser/view_type_utils.h" 42 #include "extensions/browser/view_type_utils.h"
42 #endif 43 #endif
43 44
44 using content::BrowserThread; 45 using content::BrowserThread;
45 using content::SpeechRecognitionManager; 46 using content::SpeechRecognitionManager;
46 using content::WebContents; 47 using content::WebContents;
47 48
48 namespace speech { 49 namespace speech {
49 50
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 327
327 if (!render_view_host) { 328 if (!render_view_host) {
328 // This happens for extensions. Manifest should be checked for permission. 329 // This happens for extensions. Manifest should be checked for permission.
329 allowed = true; 330 allowed = true;
330 check_permission = false; 331 check_permission = false;
331 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 332 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
332 base::Bind(callback, check_permission, allowed)); 333 base::Bind(callback, check_permission, allowed));
333 return; 334 return;
334 } 335 }
335 336
336 #if defined(ENABLE_EXTENSIONS) 337 #if BUILDFLAG(ENABLE_EXTENSIONS)
337 WebContents* web_contents = WebContents::FromRenderViewHost(render_view_host); 338 WebContents* web_contents = WebContents::FromRenderViewHost(render_view_host);
338 extensions::ViewType view_type = extensions::GetViewType(web_contents); 339 extensions::ViewType view_type = extensions::GetViewType(web_contents);
339 340
340 if (view_type == extensions::VIEW_TYPE_TAB_CONTENTS || 341 if (view_type == extensions::VIEW_TYPE_TAB_CONTENTS ||
341 view_type == extensions::VIEW_TYPE_APP_WINDOW || 342 view_type == extensions::VIEW_TYPE_APP_WINDOW ||
342 view_type == extensions::VIEW_TYPE_LAUNCHER_PAGE || 343 view_type == extensions::VIEW_TYPE_LAUNCHER_PAGE ||
343 view_type == extensions::VIEW_TYPE_COMPONENT || 344 view_type == extensions::VIEW_TYPE_COMPONENT ||
344 view_type == extensions::VIEW_TYPE_EXTENSION_POPUP || 345 view_type == extensions::VIEW_TYPE_EXTENSION_POPUP ||
345 view_type == extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) { 346 view_type == extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) {
346 // If it is a tab, we can check for permission. For apps, this means 347 // If it is a tab, we can check for permission. For apps, this means
347 // manifest would be checked for permission. 348 // manifest would be checked for permission.
348 allowed = true; 349 allowed = true;
349 check_permission = true; 350 check_permission = true;
350 } 351 }
351 #else 352 #else
352 // Otherwise this should be a regular tab contents. 353 // Otherwise this should be a regular tab contents.
353 allowed = true; 354 allowed = true;
354 check_permission = true; 355 check_permission = true;
355 #endif 356 #endif
356 357
357 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 358 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
358 base::Bind(callback, check_permission, allowed)); 359 base::Bind(callback, check_permission, allowed));
359 } 360 }
360 361
361 } // namespace speech 362 } // namespace speech
OLDNEW
« no previous file with comments | « chrome/browser/site_details.cc ('k') | chrome/browser/ssl/ssl_blocking_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698