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/extensions/api/tabs/tabs_api.h" | 5 #include "chrome/browser/extensions/api/tabs/tabs_api.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1626 reason_description = "view is invisible"; | 1626 reason_description = "view is invisible"; |
1627 break; | 1627 break; |
1628 } | 1628 } |
1629 error_ = ErrorUtils::FormatErrorMessage("Failed to capture tab: *", | 1629 error_ = ErrorUtils::FormatErrorMessage("Failed to capture tab: *", |
1630 reason_description); | 1630 reason_description); |
1631 SendResponse(false); | 1631 SendResponse(false); |
1632 } | 1632 } |
1633 | 1633 |
1634 void TabsCaptureVisibleTabFunction::RegisterProfilePrefs( | 1634 void TabsCaptureVisibleTabFunction::RegisterProfilePrefs( |
1635 user_prefs::PrefRegistrySyncable* registry) { | 1635 user_prefs::PrefRegistrySyncable* registry) { |
1636 registry->RegisterBooleanPref( | 1636 registry->RegisterBooleanPref(prefs::kDisableScreenshots, false); |
1637 prefs::kDisableScreenshots, | |
1638 false, | |
1639 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
1640 } | 1637 } |
1641 | 1638 |
1642 bool TabsDetectLanguageFunction::RunAsync() { | 1639 bool TabsDetectLanguageFunction::RunAsync() { |
1643 scoped_ptr<tabs::DetectLanguage::Params> params( | 1640 scoped_ptr<tabs::DetectLanguage::Params> params( |
1644 tabs::DetectLanguage::Params::Create(*args_)); | 1641 tabs::DetectLanguage::Params::Create(*args_)); |
1645 EXTENSION_FUNCTION_VALIDATE(params.get()); | 1642 EXTENSION_FUNCTION_VALIDATE(params.get()); |
1646 | 1643 |
1647 int tab_id = 0; | 1644 int tab_id = 0; |
1648 Browser* browser = NULL; | 1645 Browser* browser = NULL; |
1649 WebContents* contents = NULL; | 1646 WebContents* contents = NULL; |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2005 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); | 2002 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); |
2006 zoom_settings.default_zoom_factor.reset(new double( | 2003 zoom_settings.default_zoom_factor.reset(new double( |
2007 content::ZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel()))); | 2004 content::ZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel()))); |
2008 | 2005 |
2009 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); | 2006 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); |
2010 SendResponse(true); | 2007 SendResponse(true); |
2011 return true; | 2008 return true; |
2012 } | 2009 } |
2013 | 2010 |
2014 } // namespace extensions | 2011 } // namespace extensions |
OLD | NEW |