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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.cc

Issue 9232075: Have ScopedClipboardWriter and Clipboard::WriteObjects take a buffer parameter. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Un-add myself to AUTHORS. Created 8 years, 10 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
OLDNEW
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 "chrome/browser/ui/views/omnibox/omnibox_view_views.h" 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
6 6
7 #include "base/property_bag.h" 7 #include "base/property_bag.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 ui::Range selection_range; 719 ui::Range selection_range;
720 textfield_->GetSelectedRange(&selection_range); 720 textfield_->GetSelectedRange(&selection_range);
721 ui::Clipboard* cb = views::ViewsDelegate::views_delegate->GetClipboard(); 721 ui::Clipboard* cb = views::ViewsDelegate::views_delegate->GetClipboard();
722 string16 selected_text; 722 string16 selected_text;
723 cb->ReadText(ui::Clipboard::BUFFER_STANDARD, &selected_text); 723 cb->ReadText(ui::Clipboard::BUFFER_STANDARD, &selected_text);
724 const string16 text = textfield_->text(); 724 const string16 text = textfield_->text();
725 GURL url; 725 GURL url;
726 bool write_url; 726 bool write_url;
727 model_->AdjustTextForCopy(selection_range.start(), selected_text == text, 727 model_->AdjustTextForCopy(selection_range.start(), selected_text == text,
728 &selected_text, &url, &write_url); 728 &selected_text, &url, &write_url);
729 ui::ScopedClipboardWriter scw(cb); 729 ui::ScopedClipboardWriter scw(cb, ui::Clipboard::BUFFER_STANDARD);
730 scw.WriteText(selected_text); 730 scw.WriteText(selected_text);
731 if (write_url) { 731 if (write_url) {
732 BookmarkNodeData data; 732 BookmarkNodeData data;
733 data.ReadFromTuple(url, text); 733 data.ReadFromTuple(url, text);
734 data.WriteToClipboard(NULL); 734 data.WriteToClipboard(NULL);
735 } 735 }
736 } 736 }
737 737
738 void OmniboxViewViews::OnWriteDragData(ui::OSExchangeData* data) { 738 void OmniboxViewViews::OnWriteDragData(ui::OSExchangeData* data) {
739 ui::Range selection_range; 739 ui::Range selection_range;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 OmniboxViewViews* omnibox_view = new OmniboxViewViews(controller, 851 OmniboxViewViews* omnibox_view = new OmniboxViewViews(controller,
852 toolbar_model, 852 toolbar_model,
853 profile, 853 profile,
854 command_updater, 854 command_updater,
855 popup_window_mode, 855 popup_window_mode,
856 location_bar); 856 location_bar);
857 omnibox_view->Init(); 857 omnibox_view->Init();
858 return omnibox_view; 858 return omnibox_view;
859 } 859 }
860 #endif 860 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698