OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 } | 517 } |
518 UMA_HISTOGRAM_TIMES("Extensions.ContextMenus_BuildTime", | 518 UMA_HISTOGRAM_TIMES("Extensions.ContextMenus_BuildTime", |
519 base::TimeTicks::Now() - begin); | 519 base::TimeTicks::Now() - begin); |
520 UMA_HISTOGRAM_COUNTS("Extensions.ContextMenus_ItemCount", index); | 520 UMA_HISTOGRAM_COUNTS("Extensions.ContextMenus_ItemCount", index); |
521 } | 521 } |
522 | 522 |
523 void RenderViewContextMenu::InitMenu() { | 523 void RenderViewContextMenu::InitMenu() { |
524 bool has_link = !params_.unfiltered_link_url.is_empty(); | 524 bool has_link = !params_.unfiltered_link_url.is_empty(); |
525 bool has_selection = !params_.selection_text.empty(); | 525 bool has_selection = !params_.selection_text.empty(); |
526 | 526 |
527 Browser* active_browser = BrowserList::FindBrowserWithTabContents( | 527 Browser* active_browser = BrowserList::FindBrowserWithWebContents( |
528 source_tab_contents_); | 528 source_tab_contents_); |
529 if (active_browser && active_browser->is_app()) { | 529 if (active_browser && active_browser->is_app()) { |
530 const std::string ext_id = web_app::GetExtensionIdFromApplicationName( | 530 const std::string ext_id = web_app::GetExtensionIdFromApplicationName( |
531 active_browser->app_name()); | 531 active_browser->app_name()); |
532 const Extension* app = | 532 const Extension* app = |
533 profile_->GetExtensionService()->GetInstalledExtension(ext_id); | 533 profile_->GetExtensionService()->GetInstalledExtension(ext_id); |
534 if (app && app->is_platform_app()) { | 534 if (app && app->is_platform_app()) { |
535 int index = 0; | 535 int index = 0; |
536 AppendExtensionItems(app->id(), &index); | 536 AppendExtensionItems(app->id(), &index); |
537 return; | 537 return; |
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1868 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1868 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
1869 g_browser_process->clipboard()); | 1869 g_browser_process->clipboard()); |
1870 } | 1870 } |
1871 | 1871 |
1872 void RenderViewContextMenu::MediaPlayerActionAt( | 1872 void RenderViewContextMenu::MediaPlayerActionAt( |
1873 const gfx::Point& location, | 1873 const gfx::Point& location, |
1874 const WebMediaPlayerAction& action) { | 1874 const WebMediaPlayerAction& action) { |
1875 source_tab_contents_->GetRenderViewHost()-> | 1875 source_tab_contents_->GetRenderViewHost()-> |
1876 ExecuteMediaPlayerActionAtLocation(location, action); | 1876 ExecuteMediaPlayerActionAtLocation(location, action); |
1877 } | 1877 } |
OLD | NEW |