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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h

Issue 17593006: mac: Update clients of scoped_nsobject.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: iwyu, scoped_nsprotocol Created 7 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_KEYWORD_HINT_DECORATION_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_KEYWORD_HINT_DECORATION_H_
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_KEYWORD_HINT_DECORATION_H_ 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_KEYWORD_HINT_DECORATION_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #import "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h" 10 #import "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h"
11 11
12 #import "base/memory/scoped_nsobject.h" 12 #import "base/mac/scoped_nsobject.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 14
15 // Draws the keyword hint, "Press [tab] to search <site>". 15 // Draws the keyword hint, "Press [tab] to search <site>".
16 16
17 class KeywordHintDecoration : public LocationBarDecoration { 17 class KeywordHintDecoration : public LocationBarDecoration {
18 public: 18 public:
19 KeywordHintDecoration(); 19 KeywordHintDecoration();
20 virtual ~KeywordHintDecoration(); 20 virtual ~KeywordHintDecoration();
21 21
22 // Calculates the message to display and where to place the [tab] 22 // Calculates the message to display and where to place the [tab]
23 // image. 23 // image.
24 void SetKeyword(const string16& keyword, bool is_extension_keyword); 24 void SetKeyword(const string16& keyword, bool is_extension_keyword);
25 25
26 // Implement |LocationBarDecoration|. 26 // Implement |LocationBarDecoration|.
27 virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE; 27 virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE;
28 virtual CGFloat GetWidthForSpace(CGFloat width) OVERRIDE; 28 virtual CGFloat GetWidthForSpace(CGFloat width) OVERRIDE;
29 29
30 private: 30 private:
31 // Fetch and cache the [tab] image. 31 // Fetch and cache the [tab] image.
32 NSImage* GetHintImage(); 32 NSImage* GetHintImage();
33 33
34 // Attributes for drawing the hint string, such as font and color. 34 // Attributes for drawing the hint string, such as font and color.
35 scoped_nsobject<NSDictionary> attributes_; 35 base::scoped_nsobject<NSDictionary> attributes_;
36 36
37 // Cache for the [tab] image. 37 // Cache for the [tab] image.
38 scoped_nsobject<NSImage> hint_image_; 38 base::scoped_nsobject<NSImage> hint_image_;
39 39
40 // The text to display to the left and right of the hint image. 40 // The text to display to the left and right of the hint image.
41 scoped_nsobject<NSString> hint_prefix_; 41 base::scoped_nsobject<NSString> hint_prefix_;
42 scoped_nsobject<NSString> hint_suffix_; 42 base::scoped_nsobject<NSString> hint_suffix_;
43 43
44 DISALLOW_COPY_AND_ASSIGN(KeywordHintDecoration); 44 DISALLOW_COPY_AND_ASSIGN(KeywordHintDecoration);
45 }; 45 };
46 46
47 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_KEYWORD_HINT_DECORATION_H_ 47 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_KEYWORD_HINT_DECORATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698