| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tab_contents/render_view_context_menu.h" | 5 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 6 | 6 |
| 7 #include "app/clipboard/clipboard.h" | 7 #include "app/clipboard/clipboard.h" |
| 8 #include "app/clipboard/scoped_clipboard_writer.h" | 8 #include "app/clipboard/scoped_clipboard_writer.h" |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 case IDS_CONTENT_CONTEXT_OPENVIDEONEWTAB: | 432 case IDS_CONTENT_CONTEXT_OPENVIDEONEWTAB: |
| 433 return true; | 433 return true; |
| 434 | 434 |
| 435 case IDS_CONTENT_CONTEXT_SAVEPAGEAS: { | 435 case IDS_CONTENT_CONTEXT_SAVEPAGEAS: { |
| 436 // Instead of using GetURL here, we use url() (which is the "real" url of | 436 // Instead of using GetURL here, we use url() (which is the "real" url of |
| 437 // the page) from the NavigationEntry because its reflects their origin | 437 // the page) from the NavigationEntry because its reflects their origin |
| 438 // rather than the display one (returned by GetURL) which may be | 438 // rather than the display one (returned by GetURL) which may be |
| 439 // different (like having "view-source:" on the front). | 439 // different (like having "view-source:" on the front). |
| 440 NavigationEntry* active_entry = | 440 NavigationEntry* active_entry = |
| 441 source_tab_contents_->controller().GetActiveEntry(); | 441 source_tab_contents_->controller().GetActiveEntry(); |
| 442 GURL savable_url = (active_entry) ? active_entry->url() : | 442 return SavePackage::IsSavableURL( |
| 443 GURL::EmptyGURL(); | 443 (active_entry) ? active_entry->url() : GURL()); |
| 444 return SavePackage::IsSavableURL(savable_url); | |
| 445 } | 444 } |
| 446 | 445 |
| 447 case IDS_CONTENT_CONTEXT_OPENFRAMENEWTAB: | 446 case IDS_CONTENT_CONTEXT_OPENFRAMENEWTAB: |
| 448 case IDS_CONTENT_CONTEXT_OPENFRAMENEWWINDOW: | 447 case IDS_CONTENT_CONTEXT_OPENFRAMENEWWINDOW: |
| 449 return params_.frame_url.is_valid(); | 448 return params_.frame_url.is_valid(); |
| 450 | 449 |
| 451 case IDS_CONTENT_CONTEXT_UNDO: | 450 case IDS_CONTENT_CONTEXT_UNDO: |
| 452 return !!(params_.edit_flags & WebContextMenuData::CanUndo); | 451 return !!(params_.edit_flags & WebContextMenuData::CanUndo); |
| 453 | 452 |
| 454 case IDS_CONTENT_CONTEXT_REDO: | 453 case IDS_CONTENT_CONTEXT_REDO: |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 868 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
| 870 g_browser_process->clipboard()); | 869 g_browser_process->clipboard()); |
| 871 } | 870 } |
| 872 | 871 |
| 873 void RenderViewContextMenu::MediaPlayerActionAt( | 872 void RenderViewContextMenu::MediaPlayerActionAt( |
| 874 const gfx::Point& location, | 873 const gfx::Point& location, |
| 875 const WebMediaPlayerAction& action) { | 874 const WebMediaPlayerAction& action) { |
| 876 source_tab_contents_->render_view_host()->MediaPlayerActionAt( | 875 source_tab_contents_->render_view_host()->MediaPlayerActionAt( |
| 877 location, action); | 876 location, action); |
| 878 } | 877 } |
| OLD | NEW |