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

Side by Side Diff: chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm

Issue 1941943002: [Mac] Replace find_{next,prev}_Template.pdf with vector icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « chrome/app/theme/find_prev_Template.pdf ('k') | chrome/chrome_dll_bundle.gypi » ('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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/mac/bundle_locations.h" 8 #include "base/mac/bundle_locations.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "chrome/browser/ui/browser_finder.h" 10 #include "chrome/browser/ui/browser_finder.h"
(...skipping 11 matching lines...) Expand all
22 #include "content/public/browser/render_view_host.h" 22 #include "content/public/browser/render_view_host.h"
23 #include "content/public/browser/render_widget_host.h" 23 #include "content/public/browser/render_widget_host.h"
24 #include "content/public/browser/web_contents.h" 24 #include "content/public/browser/web_contents.h"
25 #include "grit/components_strings.h" 25 #include "grit/components_strings.h"
26 #include "grit/theme_resources.h" 26 #include "grit/theme_resources.h"
27 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h " 27 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h "
28 #import "ui/base/cocoa/find_pasteboard.h" 28 #import "ui/base/cocoa/find_pasteboard.h"
29 #import "ui/base/cocoa/focus_tracker.h" 29 #import "ui/base/cocoa/focus_tracker.h"
30 #import "ui/base/cocoa/nsview_additions.h" 30 #import "ui/base/cocoa/nsview_additions.h"
31 #include "ui/base/l10n/l10n_util_mac.h" 31 #include "ui/base/l10n/l10n_util_mac.h"
32 #include "ui/base/resource/resource_bundle.h"
33 #include "ui/gfx/image/image_skia_util_mac.h"
34 #include "ui/gfx/paint_vector_icon.h"
35 #include "ui/gfx/vector_icons_public.h"
32 #include "ui/resources/grit/ui_resources.h" 36 #include "ui/resources/grit/ui_resources.h"
33 37
34 using content::NativeWebKeyboardEvent; 38 using content::NativeWebKeyboardEvent;
35 39
36 const float kFindBarOpenDuration = 0.2; 40 const float kFindBarOpenDuration = 0.2;
37 const float kFindBarCloseDuration = 0.15; 41 const float kFindBarCloseDuration = 0.15;
38 const float kFindBarMoveDuration = 0.15; 42 const float kFindBarMoveDuration = 0.15;
39 const float kRightEdgeOffset = 25; 43 const float kRightEdgeOffset = 25;
40 44
41 45
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 IDS_FIND_IN_PAGE_CLOSE_TOOLTIP)]; 127 IDS_FIND_IN_PAGE_CLOSE_TOOLTIP)];
124 [previousButton_ setToolTip:l10n_util::GetNSString( 128 [previousButton_ setToolTip:l10n_util::GetNSString(
125 IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP)]; 129 IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP)];
126 [nextButton_ setToolTip:l10n_util::GetNSString( 130 [nextButton_ setToolTip:l10n_util::GetNSString(
127 IDS_FIND_IN_PAGE_NEXT_TOOLTIP)]; 131 IDS_FIND_IN_PAGE_NEXT_TOOLTIP)];
128 132
129 [closeButton_ setTitle:l10n_util::GetNSString(IDS_ACCNAME_CLOSE)]; 133 [closeButton_ setTitle:l10n_util::GetNSString(IDS_ACCNAME_CLOSE)];
130 [previousButton_ setTitle:l10n_util::GetNSString(IDS_ACCNAME_PREVIOUS)]; 134 [previousButton_ setTitle:l10n_util::GetNSString(IDS_ACCNAME_PREVIOUS)];
131 [nextButton_ setTitle:l10n_util::GetNSString(IDS_ACCNAME_NEXT)]; 135 [nextButton_ setTitle:l10n_util::GetNSString(IDS_ACCNAME_NEXT)];
132 136
137 NSImage* image = NSImageFromImageSkia(
138 gfx::CreateVectorIcon(gfx::VectorIconId::FIND_NEXT, SK_ColorBLACK));
Nico 2016/05/02 21:28:32 TIL
139 [image setTemplate:YES];
140 [nextButton_ setImage:image];
141
142 image = NSImageFromImageSkia(
143 gfx::CreateVectorIcon(gfx::VectorIconId::FIND_PREV, SK_ColorBLACK));
144 [image setTemplate:YES];
145 [previousButton_ setImage:image];
146
133 [findBarView_ setFrame:[self hiddenFindBarFrame]]; 147 [findBarView_ setFrame:[self hiddenFindBarFrame]];
134 defaultWidth_ = NSWidth([findBarView_ frame]); 148 defaultWidth_ = NSWidth([findBarView_ frame]);
135 [[self view] setHidden:YES]; 149 [[self view] setHidden:YES];
136 150
137 [self prepopulateText:[[FindPasteboard sharedInstance] findText]]; 151 [self prepopulateText:[[FindPasteboard sharedInstance] findText]];
138 } 152 }
139 153
140 - (IBAction)close:(id)sender { 154 - (IBAction)close:(id)sender {
141 if (findBarBridge_) { 155 if (findBarBridge_) {
142 findBarBridge_->GetFindBarController()->EndFindSession( 156 findBarBridge_->GetFindBarController()->EndFindSession(
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 } 652 }
639 653
640 - (BrowserWindowController*)browserWindowController { 654 - (BrowserWindowController*)browserWindowController {
641 if (!browser_) 655 if (!browser_)
642 return nil; 656 return nil;
643 return [BrowserWindowController 657 return [BrowserWindowController
644 browserWindowControllerForWindow:browser_->window()->GetNativeWindow()]; 658 browserWindowControllerForWindow:browser_->window()->GetNativeWindow()];
645 } 659 }
646 660
647 @end 661 @end
OLDNEW
« no previous file with comments | « chrome/app/theme/find_prev_Template.pdf ('k') | chrome/chrome_dll_bundle.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698