Chromium Code Reviews| Index: chrome/browser/extensions/api/tabs/tabs.cc |
| diff --git a/chrome/browser/extensions/api/tabs/tabs.cc b/chrome/browser/extensions/api/tabs/tabs.cc |
| index 3d80a52e7ef640dd813a48194a717a80f717f276..f082cf0409ca9fd687a5f3e37878fa379cede000 100644 |
| --- a/chrome/browser/extensions/api/tabs/tabs.cc |
| +++ b/chrome/browser/extensions/api/tabs/tabs.cc |
| @@ -19,6 +19,7 @@ |
| #include "base/string_util.h" |
| #include "base/stringprintf.h" |
| #include "base/utf_string_conversions.h" |
| +#include "chrome/browser/browser_process.h" |
|
Mattias Nissler (ping if slow)
2012/07/12 08:59:32
still required?
qfel
2012/07/12 14:48:06
Done.
|
| #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
| #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| #include "chrome/browser/extensions/extension_function_util.h" |
| @@ -30,6 +31,7 @@ |
| #include "chrome/browser/extensions/extension_window_list.h" |
| #include "chrome/browser/extensions/script_executor.h" |
| #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| +#include "chrome/browser/prefs/pref_service.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/sessions/restore_tab_helper.h" |
| #include "chrome/browser/translate/translate_tab_helper.h" |
| @@ -1599,6 +1601,12 @@ bool CaptureVisibleTabFunction::GetTabToCapture( |
| }; |
| bool CaptureVisibleTabFunction::RunImpl() { |
| + PrefService* service = profile()->GetPrefs(); |
| + if (service->GetBoolean(prefs::kDisableScreenshots)) { |
| + error_ = keys::kScreenshotsDisabled; |
| + return false; |
| + } |
| + |
| WebContents* web_contents = NULL; |
| TabContents* tab_contents = NULL; |
| if (!GetTabToCapture(&web_contents, &tab_contents)) |
| @@ -1756,6 +1764,11 @@ void CaptureVisibleTabFunction::SendResultFromBitmap( |
| SendResponse(true); |
| } |
| +void CaptureVisibleTabFunction::RegisterUserPrefs(PrefService* service) { |
| + service->RegisterBooleanPref(prefs::kDisableScreenshots, false, |
| + PrefService::UNSYNCABLE_PREF); |
| +} |
| + |
| bool DetectTabLanguageFunction::RunImpl() { |
| int tab_id = 0; |
| Browser* browser = NULL; |