OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/api/tabs/tabs_event_router.h" | 5 #include "chrome/browser/extensions/api/tabs/tabs_event_router.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" | 10 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 DispatchEvent(profile, | 389 DispatchEvent(profile, |
390 tabs::OnMoved::kEventName, | 390 tabs::OnMoved::kEventName, |
391 args.Pass(), | 391 args.Pass(), |
392 EventRouter::USER_GESTURE_UNKNOWN); | 392 EventRouter::USER_GESTURE_UNKNOWN); |
393 } | 393 } |
394 | 394 |
395 void TabsEventRouter::TabUpdated(WebContents* contents, bool did_navigate) { | 395 void TabsEventRouter::TabUpdated(WebContents* contents, bool did_navigate) { |
396 TabEntry* entry = GetTabEntry(contents); | 396 TabEntry* entry = GetTabEntry(contents); |
397 scoped_ptr<base::DictionaryValue> changed_properties; | 397 scoped_ptr<base::DictionaryValue> changed_properties; |
398 | 398 |
399 CHECK(entry); | 399 if (!entry) |
| 400 return; |
400 | 401 |
401 if (did_navigate) | 402 if (did_navigate) |
402 changed_properties.reset(entry->DidNavigate(contents)); | 403 changed_properties.reset(entry->DidNavigate(contents)); |
403 else | 404 else |
404 changed_properties.reset(entry->UpdateLoadState(contents)); | 405 changed_properties.reset(entry->UpdateLoadState(contents)); |
405 | 406 |
406 if (changed_properties) | 407 if (changed_properties) |
407 DispatchTabUpdatedEvent(contents, changed_properties.Pass()); | 408 DispatchTabUpdatedEvent(contents, changed_properties.Pass()); |
408 } | 409 } |
409 | 410 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 void TabsEventRouter::OnFaviconUpdated(favicon::FaviconDriver* favicon_driver, | 590 void TabsEventRouter::OnFaviconUpdated(favicon::FaviconDriver* favicon_driver, |
590 bool icon_url_changed) { | 591 bool icon_url_changed) { |
591 if (icon_url_changed) { | 592 if (icon_url_changed) { |
592 favicon::ContentFaviconDriver* content_favicon_driver = | 593 favicon::ContentFaviconDriver* content_favicon_driver = |
593 static_cast<favicon::ContentFaviconDriver*>(favicon_driver); | 594 static_cast<favicon::ContentFaviconDriver*>(favicon_driver); |
594 FaviconUrlUpdated(content_favicon_driver->web_contents()); | 595 FaviconUrlUpdated(content_favicon_driver->web_contents()); |
595 } | 596 } |
596 } | 597 } |
597 | 598 |
598 } // namespace extensions | 599 } // namespace extensions |
OLD | NEW |