| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/installable/installable_manager.h" | 5 #include "chrome/browser/installable/installable_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "chrome/browser/manifest/manifest_icon_downloader.h" | 10 #include "chrome/browser/manifest/manifest_icon_downloader.h" |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 icon.url = icon_url; | 470 icon.url = icon_url; |
| 471 icon.icon.reset(new SkBitmap(bitmap)); | 471 icon.icon.reset(new SkBitmap(bitmap)); |
| 472 } | 472 } |
| 473 | 473 |
| 474 WorkOnTask(); | 474 WorkOnTask(); |
| 475 } | 475 } |
| 476 | 476 |
| 477 void InstallableManager::DidFinishNavigation( | 477 void InstallableManager::DidFinishNavigation( |
| 478 content::NavigationHandle* handle) { | 478 content::NavigationHandle* handle) { |
| 479 if (handle->IsInMainFrame() && handle->HasCommitted() && | 479 if (handle->IsInMainFrame() && handle->HasCommitted() && |
| 480 !handle->IsSamePage()) { | 480 !handle->IsSameDocument()) { |
| 481 Reset(); | 481 Reset(); |
| 482 } | 482 } |
| 483 } | 483 } |
| 484 | 484 |
| 485 void InstallableManager::WebContentsDestroyed() { | 485 void InstallableManager::WebContentsDestroyed() { |
| 486 Reset(); | 486 Reset(); |
| 487 Observe(nullptr); | 487 Observe(nullptr); |
| 488 } | 488 } |
| 489 | 489 |
| 490 const GURL& InstallableManager::manifest_url() const { | 490 const GURL& InstallableManager::manifest_url() const { |
| 491 return manifest_->url; | 491 return manifest_->url; |
| 492 } | 492 } |
| 493 | 493 |
| 494 const content::Manifest& InstallableManager::manifest() const { | 494 const content::Manifest& InstallableManager::manifest() const { |
| 495 return manifest_->manifest; | 495 return manifest_->manifest; |
| 496 } | 496 } |
| 497 | 497 |
| 498 bool InstallableManager::is_installable() const { | 498 bool InstallableManager::is_installable() const { |
| 499 return installable_->installable; | 499 return installable_->installable; |
| 500 } | 500 } |
| OLD | NEW |