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 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1614 content::Source<NavigationController>(&(contents->GetController()))); | 1614 content::Source<NavigationController>(&(contents->GetController()))); |
1615 return true; | 1615 return true; |
1616 } | 1616 } |
1617 | 1617 |
1618 void TabsDetectLanguageFunction::Observe( | 1618 void TabsDetectLanguageFunction::Observe( |
1619 int type, | 1619 int type, |
1620 const content::NotificationSource& source, | 1620 const content::NotificationSource& source, |
1621 const content::NotificationDetails& details) { | 1621 const content::NotificationDetails& details) { |
1622 std::string language; | 1622 std::string language; |
1623 if (type == chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED) { | 1623 if (type == chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED) { |
1624 const LanguageDetectionDetails* lang_det_details = | 1624 const translate::LanguageDetectionDetails* lang_det_details = |
1625 content::Details<const LanguageDetectionDetails>(details).ptr(); | 1625 content::Details<const translate::LanguageDetectionDetails>(details) |
| 1626 .ptr(); |
1626 language = lang_det_details->adopted_language; | 1627 language = lang_det_details->adopted_language; |
1627 } | 1628 } |
1628 | 1629 |
1629 registrar_.RemoveAll(); | 1630 registrar_.RemoveAll(); |
1630 | 1631 |
1631 // Call GotLanguage in all cases as we want to guarantee the callback is | 1632 // Call GotLanguage in all cases as we want to guarantee the callback is |
1632 // called for every API call the extension made. | 1633 // called for every API call the extension made. |
1633 GotLanguage(language); | 1634 GotLanguage(language); |
1634 } | 1635 } |
1635 | 1636 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1903 ZoomController::ZoomMode zoom_mode = zoom_controller->zoom_mode(); | 1904 ZoomController::ZoomMode zoom_mode = zoom_controller->zoom_mode(); |
1904 api::tabs::ZoomSettings zoom_settings; | 1905 api::tabs::ZoomSettings zoom_settings; |
1905 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); | 1906 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); |
1906 | 1907 |
1907 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); | 1908 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); |
1908 SendResponse(true); | 1909 SendResponse(true); |
1909 return true; | 1910 return true; |
1910 } | 1911 } |
1911 | 1912 |
1912 } // namespace extensions | 1913 } // namespace extensions |
OLD | NEW |