OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |