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

Side by Side Diff: chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc

Issue 67923002: Fixes for -Wunused-function on Linux, Android and ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase for realz Created 7 years, 1 month 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/gtk/omnibox/omnibox_view_gtk.h" 5 #include "chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 const char kSecureSchemeColor[] = "#079500"; 61 const char kSecureSchemeColor[] = "#079500";
62 const char kSecurityErrorSchemeColor[] = "#a20000"; 62 const char kSecurityErrorSchemeColor[] = "#a20000";
63 63
64 const double kStrikethroughStrokeRed = 162.0 / 256.0; 64 const double kStrikethroughStrokeRed = 162.0 / 256.0;
65 const double kStrikethroughStrokeWidth = 2.0; 65 const double kStrikethroughStrokeWidth = 2.0;
66 66
67 size_t GetUTF8Offset(const string16& text, size_t text_offset) { 67 size_t GetUTF8Offset(const string16& text, size_t text_offset) {
68 return UTF16ToUTF8(text.substr(0, text_offset)).size(); 68 return UTF16ToUTF8(text.substr(0, text_offset)).size();
69 } 69 }
70 70
71 // A helper method for determining a valid drag operation given the allowed
72 // operation. We prefer copy over link.
73 int CopyOrLinkDragOperation(int drag_operation) {
74 if (drag_operation & ui::DragDropTypes::DRAG_COPY)
75 return ui::DragDropTypes::DRAG_COPY;
76 if (drag_operation & ui::DragDropTypes::DRAG_LINK)
77 return ui::DragDropTypes::DRAG_LINK;
78 return ui::DragDropTypes::DRAG_NONE;
79 }
80
81 // Stores GTK+-specific state so it can be restored after switching tabs. 71 // Stores GTK+-specific state so it can be restored after switching tabs.
82 struct ViewState { 72 struct ViewState {
83 explicit ViewState(const OmniboxViewGtk::CharRange& selection_range) 73 explicit ViewState(const OmniboxViewGtk::CharRange& selection_range)
84 : selection_range(selection_range) { 74 : selection_range(selection_range) {
85 } 75 }
86 76
87 // Range of selected text. 77 // Range of selected text.
88 OmniboxViewGtk::CharRange selection_range; 78 OmniboxViewGtk::CharRange selection_range;
89 }; 79 };
90 80
(...skipping 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after
2129 void OmniboxViewGtk::AdjustVerticalAlignmentOfGrayTextView() { 2119 void OmniboxViewGtk::AdjustVerticalAlignmentOfGrayTextView() {
2130 // By default, GtkTextView layouts an anchored child widget just above the 2120 // By default, GtkTextView layouts an anchored child widget just above the
2131 // baseline, so we need to move the |gray_text_view_| down to make sure it 2121 // baseline, so we need to move the |gray_text_view_| down to make sure it
2132 // has the same baseline as the |text_view_|. 2122 // has the same baseline as the |text_view_|.
2133 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(gray_text_view_)); 2123 PangoLayout* layout = gtk_label_get_layout(GTK_LABEL(gray_text_view_));
2134 int height; 2124 int height;
2135 pango_layout_get_size(layout, NULL, &height); 2125 pango_layout_get_size(layout, NULL, &height);
2136 int baseline = pango_layout_get_baseline(layout); 2126 int baseline = pango_layout_get_baseline(layout);
2137 g_object_set(gray_text_anchor_tag_, "rise", baseline - height, NULL); 2127 g_object_set(gray_text_anchor_tag_, "rise", baseline - height, NULL);
2138 } 2128 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.cc ('k') | chrome/browser/ui/views/frame/browser_view_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698