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

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

Issue 340003002: Revert of views: Move MenuButton from TextButton to LabelButton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 base::string16 selected_text = GetSelectedText(); 937 base::string16 selected_text = GetSelectedText();
938 model()->AdjustTextForCopy(GetSelectedRange().GetMin(), is_all_selected, 938 model()->AdjustTextForCopy(GetSelectedRange().GetMin(), is_all_selected,
939 &selected_text, &url, &write_url); 939 &selected_text, &url, &write_url);
940 data->SetString(selected_text); 940 data->SetString(selected_text);
941 if (write_url) { 941 if (write_url) {
942 gfx::Image favicon; 942 gfx::Image favicon;
943 base::string16 title = selected_text; 943 base::string16 title = selected_text;
944 if (is_all_selected) 944 if (is_all_selected)
945 model()->GetDataForURLExport(&url, &title, &favicon); 945 model()->GetDataForURLExport(&url, &title, &favicon);
946 button_drag_utils::SetURLAndDragImage(url, title, favicon.AsImageSkia(), 946 button_drag_utils::SetURLAndDragImage(url, title, favicon.AsImageSkia(),
947 NULL, data, GetWidget()); 947 data, GetWidget());
948 data->SetURL(url, title); 948 data->SetURL(url, title);
949 } 949 }
950 } 950 }
951 951
952 void OmniboxViewViews::OnGetDragOperationsForTextfield(int* drag_operations) { 952 void OmniboxViewViews::OnGetDragOperationsForTextfield(int* drag_operations) {
953 base::string16 selected_text = GetSelectedText(); 953 base::string16 selected_text = GetSelectedText();
954 GURL url; 954 GURL url;
955 bool write_url; 955 bool write_url;
956 model()->AdjustTextForCopy(GetSelectedRange().GetMin(), IsSelectAll(), 956 model()->AdjustTextForCopy(GetSelectedRange().GetMin(), IsSelectAll(),
957 &selected_text, &url, &write_url); 957 &selected_text, &url, &write_url);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 menu_contents->InsertItemWithStringIdAt( 1009 menu_contents->InsertItemWithStringIdAt(
1010 select_all_position + 1, IDS_SHOW_URL, IDS_SHOW_URL); 1010 select_all_position + 1, IDS_SHOW_URL, IDS_SHOW_URL);
1011 } 1011 }
1012 1012
1013 // Minor note: We use IDC_ for command id here while the underlying textfield 1013 // Minor note: We use IDC_ for command id here while the underlying textfield
1014 // is using IDS_ for all its command ids. This is because views cannot depend 1014 // is using IDS_ for all its command ids. This is because views cannot depend
1015 // on IDC_ for now. 1015 // on IDC_ for now.
1016 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, 1016 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES,
1017 IDS_EDIT_SEARCH_ENGINES); 1017 IDS_EDIT_SEARCH_ENGINES);
1018 } 1018 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | chrome/browser/ui/views/profiles/avatar_label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698