Skip to content

Commit

Permalink
Media indicator for background recording task
Browse files Browse the repository at this point in the history
BUG=323766
TEST=MediaTrayItemTest.NotifyMediaCaptureChange

Review URL: https://codereview.chromium.org/253183003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268077 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
oshima@chromium.org committed May 3, 2014
1 parent fc2b46b commit 7009d9b
Show file tree
Hide file tree
Showing 25 changed files with 767 additions and 258 deletions.
18 changes: 12 additions & 6 deletions ash/ash.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -325,21 +325,21 @@
'system/chromeos/audio/tray_audio_chromeos.h',
'system/chromeos/audio/tray_audio_delegate_chromeos.cc',
'system/chromeos/audio/tray_audio_delegate_chromeos.h',
'system/chromeos/enterprise/enterprise_domain_observer.h',
'system/chromeos/bluetooth/bluetooth_notification_controller.cc',
'system/chromeos/bluetooth/bluetooth_notification_controller.h',
'system/chromeos/brightness/brightness_controller_chromeos.cc',
'system/chromeos/brightness/brightness_controller_chromeos.h',
'system/chromeos/brightness/tray_brightness.cc',
'system/chromeos/brightness/tray_brightness.h',
'system/chromeos/enterprise/tray_enterprise.h',
'system/chromeos/enterprise/enterprise_domain_observer.h',
'system/chromeos/enterprise/tray_enterprise.cc',
'system/chromeos/enterprise/tray_enterprise.h',
'system/chromeos/keyboard_brightness_controller.cc',
'system/chromeos/keyboard_brightness_controller.h',
'system/chromeos/label_tray_view.h',
'system/chromeos/label_tray_view.cc',
'system/chromeos/managed/tray_locally_managed_user.h',
'system/chromeos/label_tray_view.h',
'system/chromeos/managed/tray_locally_managed_user.cc',
'system/chromeos/managed/tray_locally_managed_user.h',
'system/chromeos/network/network_connect.cc',
'system/chromeos/network/network_connect.h',
'system/chromeos/network/network_detailed_view.h',
Expand Down Expand Up @@ -441,6 +441,9 @@
'system/tray/fixed_sized_scroll_view.h',
'system/tray/hover_highlight_view.cc',
'system/tray/hover_highlight_view.h',
'system/tray/media_security/media_capture_observer.h',
'system/tray/media_security/multi_profile_media_tray_item.cc',
'system/tray/media_security/multi_profile_media_tray_item.h',
'system/tray/special_popup_row.cc',
'system/tray/special_popup_row.h',
'system/tray/system_tray.cc',
Expand Down Expand Up @@ -729,6 +732,9 @@
['exclude', 'display/display_configurator_animation.h'],
['exclude', 'display/resolution_notification_controller.cc'],
['exclude', 'display/resolution_notification_controller.h'],
['exclude', 'system/tray/media_security/media_capture_observer.h'],
['exclude', 'system/tray/media_security/multi_profile_media_tray_item.cc'],
['exclude', 'system/tray/media_security/multi_profile_media_tray_item.h'],
],
}],
],
Expand Down Expand Up @@ -966,6 +972,7 @@
'system/chromeos/tray_display_unittest.cc',
'system/date/date_view_unittest.cc',
'system/overview/overview_button_tray_unittest.cc',
'system/tray/media_security/multi_profile_media_tray_item_unittest.cc',
'system/tray/system_tray_unittest.cc',
'system/tray/tray_details_view_unittest.cc',
'system/user/tray_user_unittest.cc',
Expand Down Expand Up @@ -1031,6 +1038,7 @@
['exclude', 'wm/workspace/workspace_window_resizer_unittest.cc'],
['exclude', 'sticky_keys/sticky_keys_overlay_unittest.cc'],
['exclude', 'sticky_keys/sticky_keys_unittest.cc'],
['exclude', 'system/tray/media_security/multi_profile_media_tray_item_unittest.cc'],
['exclude', 'autoclick/autoclick_unittest.cc'],
],
'sources': [
Expand Down Expand Up @@ -1117,8 +1125,6 @@
'sources': [
'../content/app/startup_helper_win.cc',
'../ui/views/test/test_views_delegate.cc',
'session/session_state_delegate_stub.cc',
'session/session_state_delegate_stub.h',
'shell/app_list.cc',
'shell/bubble.cc',
'shell/content_client/shell_browser_main_parts.cc',
Expand Down
11 changes: 11 additions & 0 deletions ash/ash_chromeos_strings.grdp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,17 @@ Server message: <ph name="server_msg">$3<ex>Incorrect password</ex></ph>
Stop
</message>

<!-- Status tray media recording state strings. -->
<message name="IDS_ASH_STATUS_TRAY_MEDIA_RECORDING_AUDIO" desc="label used to indicate that the microphone is used by a background user">
Micropohne is in use.
</message>
<message name="IDS_ASH_STATUS_TRAY_MEDIA_RECORDING_VIDEO" desc="label used to indicate that the camera is used by a background user">
Camera is in use.
</message>
<message name="IDS_ASH_STATUS_TRAY_MEDIA_RECORDING_AUDIO_VIDEO" desc="label used to indicate that the camera and microphone are used by a background user">
Camera and microphone are in use.
</message>

<!-- Status tray screen share strings. -->
<message name="IDS_ASH_STATUS_TRAY_SCREEN_SHARE_STOP" desc="label used for screen sharing stop button">
Stop
Expand Down
18 changes: 18 additions & 0 deletions ash/ash_view_ids.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ASH_ASH_VIEW_IDS_H_
#define ASH_ASH_VIEW_IDS_H_

namespace ash {

enum ViewID {
VIEW_ID_NONE = 10000,
VIEW_ID_MEDIA_TRAY_VIEW,
VIEW_ID_USER_VIEW_MEDIA_INDICATOR,
};

} // namespace ash

#endif // ASH_ASH_VIEW_IDS_H_
16 changes: 16 additions & 0 deletions ash/media_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@
#ifndef ASH_MEDIA_DELEGATE_H_
#define ASH_MEDIA_DELEGATE_H_

namespace content {
class BrowserContext;
}

namespace ash {

enum MediaCaptureState {
MEDIA_CAPTURE_NONE = 0,
MEDIA_CAPTURE_AUDIO = 1 << 0,
MEDIA_CAPTURE_VIDEO = 1 << 1,
MEDIA_CAPTURE_AUDIO_VIDEO = MEDIA_CAPTURE_AUDIO | MEDIA_CAPTURE_VIDEO,
};

// A delegate class to control media playback.
class MediaDelegate {
public:
Expand All @@ -20,6 +31,11 @@ class MediaDelegate {

// Handles the Previous Track Media shortcut key.
virtual void HandleMediaPrevTrack() = 0;

// Returns the current media recording state of web contents
// that belongs to the |context|.
virtual MediaCaptureState GetMediaCaptureState(
content::BrowserContext* context) = 0;
};

} // namespace ash
Expand Down
3 changes: 3 additions & 0 deletions ash/resources/ash_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@

<structure type="chrome_scaled_image" name="IDR_AURA_WARNING_ICON" file="common/alert_small.png" />

<!-- TODO(oshima): Make following resources cros only -->
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_ACCESSIBILITY" file="cros/status/status_accessibility_mode.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_ACCESSIBILITY_DARK" file="cros/status/status_accessibility_dark.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_BLUETOOTH" file="cros/status/status_bluetooth.png" />
Expand Down Expand Up @@ -187,6 +188,8 @@
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_VPN" file="cros/network/statusbar_vpn_dark.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_VPN_BADGE" file="cros/network/statusbar_network_vpn_badge.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_WIRED" file="cros/network/statusbar_wired.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_RECORDING" file="cros/status/status_recording.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_RECORDING_RED" file="cros/status/status_recording_red.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_VIRTUAL_KEYBOARD" file="cros/status/status_virtual_keyboard.png" />
</if>

Expand Down
137 changes: 0 additions & 137 deletions ash/session/session_state_delegate_stub.cc

This file was deleted.

58 changes: 0 additions & 58 deletions ash/session/session_state_delegate_stub.h

This file was deleted.

Loading

0 comments on commit 7009d9b

Please sign in to comment.