| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/renderer/manifest/manifest_manager.h" | 5 #include "content/renderer/manifest/manifest_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/strings/nullable_string16.h" | 8 #include "base/strings/nullable_string16.h" |
| 9 #include "content/common/manifest_manager_messages.h" | 9 #include "content/common/manifest_manager_messages.h" |
| 10 #include "content/public/renderer/render_frame.h" | 10 #include "content/public/renderer/render_frame.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 return; | 94 return; |
| 95 | 95 |
| 96 FetchManifest(); | 96 FetchManifest(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void ManifestManager::DidChangeManifest() { | 99 void ManifestManager::DidChangeManifest() { |
| 100 may_have_manifest_ = true; | 100 may_have_manifest_ = true; |
| 101 manifest_dirty_ = true; | 101 manifest_dirty_ = true; |
| 102 } | 102 } |
| 103 | 103 |
| 104 void ManifestManager::DidCommitProvisionalLoad(bool is_new_navigation) { |
| 105 may_have_manifest_ = false; |
| 106 manifest_dirty_ = true; |
| 107 } |
| 108 |
| 104 void ManifestManager::FetchManifest() { | 109 void ManifestManager::FetchManifest() { |
| 105 GURL url(render_frame()->GetWebFrame()->document().manifestURL()); | 110 GURL url(render_frame()->GetWebFrame()->document().manifestURL()); |
| 106 | 111 |
| 107 if (url.is_empty()) { | 112 if (url.is_empty()) { |
| 108 ManifestUmaUtil::FetchFailed(ManifestUmaUtil::FETCH_EMPTY_URL); | 113 ManifestUmaUtil::FetchFailed(ManifestUmaUtil::FETCH_EMPTY_URL); |
| 109 ResolveCallbacks(ResolveStateFailure); | 114 ResolveCallbacks(ResolveStateFailure); |
| 110 return; | 115 return; |
| 111 } | 116 } |
| 112 | 117 |
| 113 fetcher_.reset(new ManifestFetcher(url)); | 118 fetcher_.reset(new ManifestFetcher(url)); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 168 |
| 164 pending_callbacks_.clear(); | 169 pending_callbacks_.clear(); |
| 165 | 170 |
| 166 for (std::list<GetManifestCallback>::const_iterator it = callbacks.begin(); | 171 for (std::list<GetManifestCallback>::const_iterator it = callbacks.begin(); |
| 167 it != callbacks.end(); ++it) { | 172 it != callbacks.end(); ++it) { |
| 168 it->Run(manifest); | 173 it->Run(manifest); |
| 169 } | 174 } |
| 170 } | 175 } |
| 171 | 176 |
| 172 } // namespace content | 177 } // namespace content |
| OLD | NEW |