Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc

Issue 1431713004: MimeHandlerViewGuest: Ignore title changes due to navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues t.h" 5 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues t.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "components/guest_view/common/guest_view_constants.h" 8 #include "components/guest_view/common/guest_view_constants.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 #include "content/public/browser/host_zoom_map.h" 10 #include "content/public/browser/host_zoom_map.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 return embedder_web_contents()->GetDelegate()->OpenURLFromTab( 162 return embedder_web_contents()->GetDelegate()->OpenURLFromTab(
163 embedder_web_contents(), params); 163 embedder_web_contents(), params);
164 } 164 }
165 165
166 void MimeHandlerViewGuest::NavigationStateChanged( 166 void MimeHandlerViewGuest::NavigationStateChanged(
167 WebContents* source, 167 WebContents* source,
168 content::InvalidateTypes changed_flags) { 168 content::InvalidateTypes changed_flags) {
169 if (!(changed_flags & content::INVALIDATE_TYPE_TITLE)) 169 if (!(changed_flags & content::INVALIDATE_TYPE_TITLE))
170 return; 170 return;
171 171
172 // Only consider title changes not triggered by URL changes. Otherwise, the
173 // URL of the mime handler will be displayed.
174 if (changed_flags & content::INVALIDATE_TYPE_URL)
175 return;
176
172 if (!is_full_page_plugin()) 177 if (!is_full_page_plugin())
173 return; 178 return;
174 179
175 content::NavigationEntry* last_committed_entry = 180 content::NavigationEntry* last_committed_entry =
176 embedder_web_contents()->GetController().GetLastCommittedEntry(); 181 embedder_web_contents()->GetController().GetLastCommittedEntry();
177 if (last_committed_entry) { 182 if (last_committed_entry) {
178 last_committed_entry->SetTitle(source->GetTitle()); 183 last_committed_entry->SetTitle(source->GetTitle());
179 embedder_web_contents()->GetDelegate()->NavigationStateChanged( 184 embedder_web_contents()->GetDelegate()->NavigationStateChanged(
180 embedder_web_contents(), changed_flags); 185 embedder_web_contents(), changed_flags);
181 } 186 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 element_instance_id())); 230 element_instance_id()));
226 } 231 }
227 232
228 base::WeakPtr<StreamContainer> MimeHandlerViewGuest::GetStream() const { 233 base::WeakPtr<StreamContainer> MimeHandlerViewGuest::GetStream() const {
229 if (!stream_) 234 if (!stream_)
230 return base::WeakPtr<StreamContainer>(); 235 return base::WeakPtr<StreamContainer>();
231 return stream_->GetWeakPtr(); 236 return stream_->GetWeakPtr();
232 } 237 }
233 238
234 } // namespace extensions 239 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698