Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: chrome/browser/tab_contents/render_view_context_menu_controller.cc

Issue 28294: Modified clipboard classes to use string16 instead of std::wstring (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/renderer_host/resource_message_filter.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/resource_message_filter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698