| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/gears_integration.h" | 5 #include "chrome/browser/gears_integration.h" |
| 6 | 6 |
| 7 #include "base/gfx/png_encoder.h" | 7 #include "base/gfx/png_encoder.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "chrome/browser/chrome_plugin_host.h" | 11 #include "chrome/browser/chrome_plugin_host.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 std::string name_utf8 = WideToUTF8(name); | 248 std::string name_utf8 = WideToUTF8(name); |
| 249 std::string description_utf8 = WideToUTF8(app_info.description); | 249 std::string description_utf8 = WideToUTF8(app_info.description); |
| 250 const GURL& url = | 250 const GURL& url = |
| 251 !app_info.app_url.is_empty() ? app_info.app_url : fallback_url; | 251 !app_info.app_url.is_empty() ? app_info.app_url : fallback_url; |
| 252 | 252 |
| 253 CreateShortcutCommand* command = | 253 CreateShortcutCommand* command = |
| 254 new CreateShortcutCommand(name_utf8, orig_name_utf8, url.spec(), | 254 new CreateShortcutCommand(name_utf8, orig_name_utf8, url.spec(), |
| 255 description_utf8, | 255 description_utf8, |
| 256 app_info.icons, fallback_icon, callback); | 256 app_info.icons, fallback_icon, callback); |
| 257 CPHandleCommand(GEARSPLUGINCOMMAND_CREATE_SHORTCUT, command, 0u); | 257 CPHandleCommand(GEARSPLUGINCOMMAND_CREATE_SHORTCUT, command, NULL); |
| 258 } | 258 } |
| 259 | 259 |
| 260 // This class holds and manages the data passed to the | 260 // This class holds and manages the data passed to the |
| 261 // GEARSPLUGINCOMMAND_GET_SHORTCUT_LIST plugin command. When the command is | 261 // GEARSPLUGINCOMMAND_GET_SHORTCUT_LIST plugin command. When the command is |
| 262 // invoked, we proxy the results over to the calling thread. | 262 // invoked, we proxy the results over to the calling thread. |
| 263 class QueryShortcutsCommand : public CPCommandInterface { | 263 class QueryShortcutsCommand : public CPCommandInterface { |
| 264 public: | 264 public: |
| 265 explicit QueryShortcutsCommand(GearsQueryShortcutsCallback* callback) : | 265 explicit QueryShortcutsCommand(GearsQueryShortcutsCallback* callback) : |
| 266 callback_(callback), calling_loop_(MessageLoop::current()) { | 266 callback_(callback), calling_loop_(MessageLoop::current()) { |
| 267 shortcut_list_.shortcuts = NULL; | 267 shortcut_list_.shortcuts = NULL; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 QueryShortcutsCommand* remover) { | 304 QueryShortcutsCommand* remover) { |
| 305 } | 305 } |
| 306 template<> | 306 template<> |
| 307 void RunnableMethodTraits<QueryShortcutsCommand>::ReleaseCallee( | 307 void RunnableMethodTraits<QueryShortcutsCommand>::ReleaseCallee( |
| 308 QueryShortcutsCommand* remover) { | 308 QueryShortcutsCommand* remover) { |
| 309 } | 309 } |
| 310 | 310 |
| 311 void GearsQueryShortcuts(GearsQueryShortcutsCallback* callback) { | 311 void GearsQueryShortcuts(GearsQueryShortcutsCallback* callback) { |
| 312 CPHandleCommand(GEARSPLUGINCOMMAND_GET_SHORTCUT_LIST, | 312 CPHandleCommand(GEARSPLUGINCOMMAND_GET_SHORTCUT_LIST, |
| 313 new QueryShortcutsCommand(callback), | 313 new QueryShortcutsCommand(callback), |
| 314 0u); | 314 NULL); |
| 315 } | 315 } |
| OLD | NEW |