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

Side by Side Diff: ui/views/controls/menu/menu_image_util.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
« no previous file with comments | « ui/snapshot/test/run_all_unittests.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | 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) 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 "ui/views/controls/menu/menu_image_util.h" 5 #include "ui/views/controls/menu/menu_image_util.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "grit/ui_resources.h" 9 #include "grit/ui_resources.h"
10 #include "third_party/skia/include/effects/SkGradientShader.h" 10 #include "third_party/skia/include/effects/SkGradientShader.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 kSelectedIndicatorSize / 2, paint); 91 kSelectedIndicatorSize / 2, paint);
92 } 92 }
93 } 93 }
94 94
95 private: 95 private:
96 bool selected_; 96 bool selected_;
97 97
98 DISALLOW_COPY_AND_ASSIGN(RadioButtonImageSource); 98 DISALLOW_COPY_AND_ASSIGN(RadioButtonImageSource);
99 }; 99 };
100 100
101 gfx::ImageSkia* CreateRadioButtonImage(bool selected) {
102 RadioButtonImageSource* source = new RadioButtonImageSource(selected);
103 return new gfx::ImageSkia(source, source->size());
104 }
105
106 class SubmenuArrowImageSource : public gfx::CanvasImageSource { 101 class SubmenuArrowImageSource : public gfx::CanvasImageSource {
107 public: 102 public:
108 SubmenuArrowImageSource(int image_id) 103 SubmenuArrowImageSource(int image_id)
109 : gfx::CanvasImageSource(ui::ResourceBundle::GetSharedInstance(). 104 : gfx::CanvasImageSource(ui::ResourceBundle::GetSharedInstance().
110 GetImageNamed(image_id).ToImageSkia()->size(), false), 105 GetImageNamed(image_id).ToImageSkia()->size(), false),
111 image_id_(image_id) {} 106 image_id_(image_id) {}
112 virtual ~SubmenuArrowImageSource() {} 107 virtual ~SubmenuArrowImageSource() {}
113 108
114 virtual void Draw(gfx::Canvas* canvas) OVERRIDE { 109 virtual void Draw(gfx::Canvas* canvas) OVERRIDE {
115 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 110 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 int image_id = selected ? IDR_MENU_RADIO_SELECTED : IDR_MENU_RADIO_EMPTY; 161 int image_id = selected ? IDR_MENU_RADIO_SELECTED : IDR_MENU_RADIO_EMPTY;
167 return ui::ResourceBundle::GetSharedInstance().GetImageNamed(image_id). 162 return ui::ResourceBundle::GetSharedInstance().GetImageNamed(image_id).
168 AsImageSkia(); 163 AsImageSkia();
169 } 164 }
170 165
171 gfx::ImageSkia GetSubmenuArrowImage(bool dark_background) { 166 gfx::ImageSkia GetSubmenuArrowImage(bool dark_background) {
172 return GetRtlSubmenuArrowImage(base::i18n::IsRTL(), dark_background); 167 return GetRtlSubmenuArrowImage(base::i18n::IsRTL(), dark_background);
173 } 168 }
174 169
175 } // namespace views 170 } // namespace views
OLDNEW
« no previous file with comments | « ui/snapshot/test/run_all_unittests.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698