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

Side by Side Diff: chrome/browser/ui/panels/panel_host.cc

Issue 2019373002: Fix page transition qualifiers not masked out (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added one more occurrence. Created 4 years, 6 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/panels/panel_host.h" 5 #include "chrome/browser/ui/panels/panel_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 content::WebContents* PanelHost::OpenURLFromTab( 106 content::WebContents* PanelHost::OpenURLFromTab(
107 content::WebContents* source, 107 content::WebContents* source,
108 const content::OpenURLParams& params) { 108 const content::OpenURLParams& params) {
109 // These dispositions aren't really navigations. 109 // These dispositions aren't really navigations.
110 if (params.disposition == SUPPRESS_OPEN || 110 if (params.disposition == SUPPRESS_OPEN ||
111 params.disposition == SAVE_TO_DISK || 111 params.disposition == SAVE_TO_DISK ||
112 params.disposition == IGNORE_ACTION) 112 params.disposition == IGNORE_ACTION)
113 return NULL; 113 return NULL;
114 114
115 // Only allow clicks on links. 115 // Only allow clicks on links.
116 if (params.transition != ui::PAGE_TRANSITION_LINK) 116 if (!ui::PageTransitionCoreTypeIs(params.transition,
117 ui::PAGE_TRANSITION_LINK)) {
117 return NULL; 118 return NULL;
119 }
118 120
119 // Force all links to open in a new tab. 121 // Force all links to open in a new tab.
120 chrome::NavigateParams navigate_params(profile_, 122 chrome::NavigateParams navigate_params(profile_,
121 params.url, 123 params.url,
122 params.transition); 124 params.transition);
123 switch (params.disposition) { 125 switch (params.disposition) {
124 case NEW_BACKGROUND_TAB: 126 case NEW_BACKGROUND_TAB:
125 case NEW_WINDOW: 127 case NEW_WINDOW:
126 case OFF_THE_RECORD: 128 case OFF_THE_RECORD:
127 navigate_params.disposition = params.disposition; 129 navigate_params.disposition = params.disposition;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 244 }
243 245
244 void PanelHost::StopLoading() { 246 void PanelHost::StopLoading() {
245 content::RecordAction(UserMetricsAction("Stop")); 247 content::RecordAction(UserMetricsAction("Stop"));
246 web_contents_->Stop(); 248 web_contents_->Stop();
247 } 249 }
248 250
249 void PanelHost::Zoom(content::PageZoom zoom) { 251 void PanelHost::Zoom(content::PageZoom zoom) {
250 ui_zoom::PageZoom::Zoom(web_contents_.get(), zoom); 252 ui_zoom::PageZoom::Zoom(web_contents_.get(), zoom);
251 } 253 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/navigation_metrics_recorder.cc ('k') | chrome/browser/ui/pdf/pdf_unsupported_feature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698