| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 9 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 10 | 10 |
| (...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1481 OpenURL( | 1481 OpenURL( |
| 1482 handlers[handlerIndex].TranslateUrl(params_.link_url), | 1482 handlers[handlerIndex].TranslateUrl(params_.link_url), |
| 1483 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url, | 1483 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url, |
| 1484 params_.frame_id, | 1484 params_.frame_id, |
| 1485 disposition, | 1485 disposition, |
| 1486 content::PAGE_TRANSITION_LINK); | 1486 content::PAGE_TRANSITION_LINK); |
| 1487 return; | 1487 return; |
| 1488 } | 1488 } |
| 1489 | 1489 |
| 1490 switch (id) { | 1490 switch (id) { |
| 1491 case IDC_CONTENT_CONTEXT_OPENLINKNEWTAB: | 1491 case IDC_CONTENT_CONTEXT_OPENLINKNEWTAB: { |
| 1492 Browser* browser = |
| 1493 browser::FindBrowserWithWebContents(source_web_contents_); |
| 1492 OpenURL( | 1494 OpenURL( |
| 1493 params_.link_url, | 1495 params_.link_url, |
| 1494 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url, | 1496 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url, |
| 1495 params_.frame_id, | 1497 params_.frame_id, |
| 1496 source_web_contents_->GetDelegate() && | 1498 !browser || browser->is_app() ? |
| 1497 source_web_contents_->GetDelegate()->IsApplication() ? | 1499 NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB, |
| 1498 NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB, | |
| 1499 content::PAGE_TRANSITION_LINK); | 1500 content::PAGE_TRANSITION_LINK); |
| 1500 break; | 1501 break; |
| 1501 | 1502 } |
| 1502 case IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW: | 1503 case IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW: |
| 1503 OpenURL( | 1504 OpenURL( |
| 1504 params_.link_url, | 1505 params_.link_url, |
| 1505 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url, | 1506 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url, |
| 1506 params_.frame_id, | 1507 params_.frame_id, |
| 1507 NEW_WINDOW, content::PAGE_TRANSITION_LINK); | 1508 NEW_WINDOW, content::PAGE_TRANSITION_LINK); |
| 1508 break; | 1509 break; |
| 1509 | 1510 |
| 1510 case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD: | 1511 case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD: |
| 1511 OpenURL(params_.link_url, | 1512 OpenURL(params_.link_url, |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1978 source_web_contents_->GetRenderViewHost()-> | 1979 source_web_contents_->GetRenderViewHost()-> |
| 1979 ExecuteMediaPlayerActionAtLocation(location, action); | 1980 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1980 } | 1981 } |
| 1981 | 1982 |
| 1982 void RenderViewContextMenu::PluginActionAt( | 1983 void RenderViewContextMenu::PluginActionAt( |
| 1983 const gfx::Point& location, | 1984 const gfx::Point& location, |
| 1984 const WebPluginAction& action) { | 1985 const WebPluginAction& action) { |
| 1985 source_web_contents_->GetRenderViewHost()-> | 1986 source_web_contents_->GetRenderViewHost()-> |
| 1986 ExecutePluginActionAtLocation(location, action); | 1987 ExecutePluginActionAtLocation(location, action); |
| 1987 } | 1988 } |
| OLD | NEW |