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 <stddef.h> | 7 #include <stddef.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <limits> | 9 #include <limits> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 bool pinned = *params->update_properties.pinned; | 1269 bool pinned = *params->update_properties.pinned; |
1270 tab_strip->SetTabPinned(tab_index, pinned); | 1270 tab_strip->SetTabPinned(tab_index, pinned); |
1271 | 1271 |
1272 // Update the tab index because it may move when being pinned. | 1272 // Update the tab index because it may move when being pinned. |
1273 tab_index = tab_strip->GetIndexOfWebContents(contents); | 1273 tab_index = tab_strip->GetIndexOfWebContents(contents); |
1274 } | 1274 } |
1275 | 1275 |
1276 if (params->update_properties.muted.get()) { | 1276 if (params->update_properties.muted.get()) { |
1277 TabMutedResult tab_muted_result = chrome::SetTabAudioMuted( | 1277 TabMutedResult tab_muted_result = chrome::SetTabAudioMuted( |
1278 contents, *params->update_properties.muted, | 1278 contents, *params->update_properties.muted, |
1279 TAB_MUTED_REASON_EXTENSION, extension()->id()); | 1279 TabMutedReason::EXTENSION, extension()->id()); |
1280 | 1280 |
1281 switch (tab_muted_result) { | 1281 switch (tab_muted_result) { |
1282 case TAB_MUTED_RESULT_SUCCESS: | 1282 case TabMutedResult::SUCCESS: |
1283 break; | 1283 break; |
1284 case TAB_MUTED_RESULT_FAIL_NOT_ENABLED: | 1284 case TabMutedResult::FAIL_NOT_ENABLED: |
1285 error_ = ErrorUtils::FormatErrorMessage( | 1285 error_ = ErrorUtils::FormatErrorMessage( |
1286 keys::kCannotUpdateMuteDisabled, base::IntToString(tab_id), | 1286 keys::kCannotUpdateMuteDisabled, base::IntToString(tab_id), |
1287 switches::kEnableTabAudioMuting); | 1287 switches::kEnableTabAudioMuting); |
1288 return false; | 1288 return false; |
1289 case TAB_MUTED_RESULT_FAIL_TABCAPTURE: | 1289 case TabMutedResult::FAIL_TABCAPTURE: |
1290 error_ = ErrorUtils::FormatErrorMessage(keys::kCannotUpdateMuteCaptured, | 1290 error_ = ErrorUtils::FormatErrorMessage(keys::kCannotUpdateMuteCaptured, |
1291 base::IntToString(tab_id)); | 1291 base::IntToString(tab_id)); |
1292 return false; | 1292 return false; |
1293 } | 1293 } |
1294 } | 1294 } |
1295 | 1295 |
1296 if (params->update_properties.opener_tab_id.get()) { | 1296 if (params->update_properties.opener_tab_id.get()) { |
1297 int opener_id = *params->update_properties.opener_tab_id; | 1297 int opener_id = *params->update_properties.opener_tab_id; |
1298 | 1298 |
1299 WebContents* opener_contents = NULL; | 1299 WebContents* opener_contents = NULL; |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2131 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); | 2131 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); |
2132 zoom_settings.default_zoom_factor.reset(new double( | 2132 zoom_settings.default_zoom_factor.reset(new double( |
2133 content::ZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel()))); | 2133 content::ZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel()))); |
2134 | 2134 |
2135 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); | 2135 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); |
2136 SendResponse(true); | 2136 SendResponse(true); |
2137 return true; | 2137 return true; |
2138 } | 2138 } |
2139 | 2139 |
2140 } // namespace extensions | 2140 } // namespace extensions |
OLD | NEW |