OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Implements the Chrome Extensions WebNavigation API. | 5 // Implements the Chrome Extensions WebNavigation API. |
6 | 6 |
7 #include "chrome/browser/extensions/extension_webnavigation_api.h" | 7 #include "chrome/browser/extensions/extension_webnavigation_api.h" |
8 | 8 |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 is_main_frame, | 540 is_main_frame, |
541 url, | 541 url, |
542 transition_type); | 542 transition_type); |
543 } | 543 } |
544 } | 544 } |
545 | 545 |
546 void ExtensionWebNavigationTabObserver::DidFailProvisionalLoad( | 546 void ExtensionWebNavigationTabObserver::DidFailProvisionalLoad( |
547 int64 frame_id, | 547 int64 frame_id, |
548 bool is_main_frame, | 548 bool is_main_frame, |
549 const GURL& validated_url, | 549 const GURL& validated_url, |
550 int error_code) { | 550 int error_code, |
| 551 const string16& error_description) { |
551 if (!navigation_state_.CanSendEvents(frame_id)) | 552 if (!navigation_state_.CanSendEvents(frame_id)) |
552 return; | 553 return; |
553 navigation_state_.SetErrorOccurredInFrame(frame_id); | 554 navigation_state_.SetErrorOccurredInFrame(frame_id); |
554 DispatchOnErrorOccurred( | 555 DispatchOnErrorOccurred( |
555 tab_contents(), validated_url, frame_id, is_main_frame, error_code); | 556 tab_contents(), validated_url, frame_id, is_main_frame, error_code); |
556 } | 557 } |
557 | 558 |
558 void ExtensionWebNavigationTabObserver::DocumentLoadedInFrame( | 559 void ExtensionWebNavigationTabObserver::DocumentLoadedInFrame( |
559 int64 frame_id) { | 560 int64 frame_id) { |
560 if (!navigation_state_.CanSendEvents(frame_id)) | 561 if (!navigation_state_.CanSendEvents(frame_id)) |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 keys::kFrameIdKey, | 691 keys::kFrameIdKey, |
691 GetFrameId(navigation_state.IsMainFrame(*frame), *frame)); | 692 GetFrameId(navigation_state.IsMainFrame(*frame), *frame)); |
692 frameDict->SetBoolean( | 693 frameDict->SetBoolean( |
693 keys::kErrorOccurredKey, | 694 keys::kErrorOccurredKey, |
694 navigation_state.GetErrorOccurredInFrame(*frame)); | 695 navigation_state.GetErrorOccurredInFrame(*frame)); |
695 resultList->Append(frameDict); | 696 resultList->Append(frameDict); |
696 } | 697 } |
697 result_.reset(resultList); | 698 result_.reset(resultList); |
698 return true; | 699 return true; |
699 } | 700 } |
OLD | NEW |