OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "chrome/browser/tab_contents/render_view_context_menu_controller.h" | 7 #include "chrome/browser/tab_contents/render_view_context_menu_controller.h" |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 } | 67 } |
68 | 68 |
69 void RenderViewContextMenuController::WriteTextToClipboard( | 69 void RenderViewContextMenuController::WriteTextToClipboard( |
70 const std::wstring& text) { | 70 const std::wstring& text) { |
71 ClipboardService* clipboard = g_browser_process->clipboard_service(); | 71 ClipboardService* clipboard = g_browser_process->clipboard_service(); |
72 | 72 |
73 if (!clipboard) | 73 if (!clipboard) |
74 return; | 74 return; |
75 | 75 |
76 ScopedClipboardWriter scw(clipboard); | 76 ScopedClipboardWriter scw(clipboard); |
77 scw.WriteText(text); | 77 scw.WriteText(WideToUTF16Hack(text)); |
78 } | 78 } |
79 | 79 |
80 void RenderViewContextMenuController::WriteURLToClipboard(const GURL& url) { | 80 void RenderViewContextMenuController::WriteURLToClipboard(const GURL& url) { |
81 if (url.SchemeIs(chrome::kMailToScheme)) | 81 if (url.SchemeIs(chrome::kMailToScheme)) |
82 WriteTextToClipboard(UTF8ToWide(url.path())); | 82 WriteTextToClipboard(UTF8ToWide(url.path())); |
83 else | 83 else |
84 WriteTextToClipboard(UTF8ToWide(url.spec())); | 84 WriteTextToClipboard(UTF8ToWide(url.spec())); |
85 } | 85 } |
86 | 86 |
87 /////////////////////////////////////////////////////////////////////////////// | 87 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 // Don't enable the web inspector if JavaScript is disabled | 537 // Don't enable the web inspector if JavaScript is disabled |
538 if (id == IDS_CONTENT_CONTEXT_INSPECTELEMENT) { | 538 if (id == IDS_CONTENT_CONTEXT_INSPECTELEMENT) { |
539 PrefService* prefs = source_web_contents_->profile()->GetPrefs(); | 539 PrefService* prefs = source_web_contents_->profile()->GetPrefs(); |
540 if (!prefs->GetBoolean(prefs::kWebKitJavascriptEnabled) || | 540 if (!prefs->GetBoolean(prefs::kWebKitJavascriptEnabled) || |
541 command_line.HasSwitch(switches::kDisableJavaScript)) | 541 command_line.HasSwitch(switches::kDisableJavaScript)) |
542 return false; | 542 return false; |
543 } | 543 } |
544 | 544 |
545 return true; | 545 return true; |
546 } | 546 } |
OLD | NEW |