OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Window API implementation. | 5 // Window API implementation. |
6 // | 6 // |
7 // Window IDs are the HWND of the top-level frame window of IE. | 7 // Window IDs are the HWND of the top-level frame window of IE. |
8 | 8 |
9 #include "ceee/ie/broker/window_api_module.h" | 9 #include "ceee/ie/broker/window_api_module.h" |
10 | 10 |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 return; | 258 return; |
259 } | 259 } |
260 if (first_arg->GetType() != Value::TYPE_NULL) { | 260 if (first_arg->GetType() != Value::TYPE_NULL) { |
261 DictionaryValue* args_dict = NULL; | 261 DictionaryValue* args_dict = NULL; |
262 if (!args.GetDictionary(0, &args_dict) || args_dict == NULL) { | 262 if (!args.GetDictionary(0, &args_dict) || args_dict == NULL) { |
263 NOTREACHED() << "bad request"; | 263 NOTREACHED() << "bad request"; |
264 result->PostError(api_module_constants::kInvalidArgumentsError); | 264 result->PostError(api_module_constants::kInvalidArgumentsError); |
265 return; | 265 return; |
266 } | 266 } |
267 // Remember the arguments so that we can use them later. | 267 // Remember the arguments so that we can use them later. |
268 input_dict.reset(static_cast<DictionaryValue*>(args_dict->DeepCopy())); | 268 input_dict.reset(args_dict->DeepCopy()); |
269 } | 269 } |
270 } | 270 } |
271 | 271 |
272 // Look for optional url. | 272 // Look for optional url. |
273 scoped_ptr<GURL> spec(new GURL(chrome::kAboutBlankURL)); | 273 scoped_ptr<GURL> spec(new GURL(chrome::kAboutBlankURL)); |
274 std::string url_input; | 274 std::string url_input; |
275 if (input_dict.get() != NULL) { | 275 if (input_dict.get() != NULL) { |
276 if (input_dict->HasKey(ext::kUrlKey)) { | 276 if (input_dict->HasKey(ext::kUrlKey)) { |
277 if (!input_dict->GetString(ext::kUrlKey, &url_input)) { | 277 if (!input_dict->GetString(ext::kUrlKey, &url_input)) { |
278 NOTREACHED() << "bad request"; | 278 NOTREACHED() << "bad request"; |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 DCHECK(success) << "Failed to retrieve populate tabs that we saved ourselves"; | 687 DCHECK(success) << "Failed to retrieve populate tabs that we saved ourselves"; |
688 | 688 |
689 FillResult(result.get(), populate_tabs); | 689 FillResult(result.get(), populate_tabs); |
690 if (result->IsEmpty()) // This is an error! | 690 if (result->IsEmpty()) // This is an error! |
691 result->PostError(api_module_constants::kInternalErrorError); | 691 result->PostError(api_module_constants::kInternalErrorError); |
692 result->FlushAllPosts(); | 692 result->FlushAllPosts(); |
693 return S_OK; | 693 return S_OK; |
694 } | 694 } |
695 | 695 |
696 } // namespace window_api | 696 } // namespace window_api |
OLD | NEW |