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 "base/values.h" | 5 #include "base/values.h" |
6 #include "chrome/browser/chromeos/media/media_player.h" | 6 #include "chrome/browser/chromeos/media/media_player.h" |
7 #include "chrome/browser/chromeos/media/media_player_extension_api.h" | 7 #include "chrome/browser/chromeos/media/media_player_extension_api.h" |
8 | 8 |
9 static const char kPropertyItems[] = "items"; | 9 static const char kPropertyItems[] = "items"; |
10 static const char kPropertyPosition[] = "position"; | 10 static const char kPropertyPosition[] = "position"; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 return result; | 51 return result; |
52 } | 52 } |
53 | 53 |
54 bool GetPlaylistMediaplayerFunction::RunImpl() { | 54 bool GetPlaylistMediaplayerFunction::RunImpl() { |
55 DictionaryValue* result = new DictionaryValue(); | 55 DictionaryValue* result = new DictionaryValue(); |
56 MediaPlayer* player = MediaPlayer::GetInstance(); | 56 MediaPlayer* player = MediaPlayer::GetInstance(); |
57 | 57 |
58 result->Set(kPropertyItems, GetPlaylistItems()); | 58 result->Set(kPropertyItems, GetPlaylistItems()); |
59 result->SetInteger(kPropertyPosition, player->GetPlaylistPosition()); | 59 result->SetInteger(kPropertyPosition, player->GetPlaylistPosition()); |
60 | 60 |
61 result_.reset(result); | 61 SetResult(result); |
62 return true; | 62 return true; |
63 } | 63 } |
64 | 64 |
65 bool SetWindowHeightMediaplayerFunction::RunImpl() { | 65 bool SetWindowHeightMediaplayerFunction::RunImpl() { |
66 int height; | 66 int height; |
67 if (!args_->GetInteger(0, &height)) | 67 if (!args_->GetInteger(0, &height)) |
68 return false; | 68 return false; |
69 MediaPlayer::GetInstance()->SetWindowHeight(height); | 69 MediaPlayer::GetInstance()->SetWindowHeight(height); |
70 return true; | 70 return true; |
71 } | 71 } |
72 | 72 |
73 bool CloseWindowMediaplayerFunction::RunImpl() { | 73 bool CloseWindowMediaplayerFunction::RunImpl() { |
74 MediaPlayer::GetInstance()->CloseWindow(); | 74 MediaPlayer::GetInstance()->CloseWindow(); |
75 return true; | 75 return true; |
76 } | 76 } |
OLD | NEW |