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

Side by Side Diff: chrome/browser/cocoa/keyword_editor_cocoa_controller.h

Issue 319006: [Mac] Fix keyword editor-related crashes (Closed)
Patch Set: Address Scott's nits. Created 11 years, 2 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "app/table_model_observer.h" 7 #include "app/table_model_observer.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "chrome/browser/search_engines/edit_search_engine_controller.h" 9 #include "chrome/browser/search_engines/edit_search_engine_controller.h"
10 #include "chrome/browser/search_engines/keyword_editor_controller.h" 10 #include "chrome/browser/search_engines/keyword_editor_controller.h"
(...skipping 26 matching lines...) Expand all
37 37
38 // TableModelObserver overrides. Invalidate icon cache. 38 // TableModelObserver overrides. Invalidate icon cache.
39 virtual void OnModelChanged(); 39 virtual void OnModelChanged();
40 virtual void OnItemsChanged(int start, int length); 40 virtual void OnItemsChanged(int start, int length);
41 virtual void OnItemsAdded(int start, int length); 41 virtual void OnItemsAdded(int start, int length);
42 virtual void OnItemsRemoved(int start, int length); 42 virtual void OnItemsRemoved(int start, int length);
43 43
44 // Lazily converts the image at the given row and caches it in |iconImages_|. 44 // Lazily converts the image at the given row and caches it in |iconImages_|.
45 NSImage* GetImageForRow(int row); 45 NSImage* GetImageForRow(int row);
46 46
47 protected:
48 // Invalidates a range of the |iconImages_| cache.
49 void InvalidateIconCache(int start, int length);
50
51 private: 47 private:
52 KeywordEditorCocoaController* controller_; 48 KeywordEditorCocoaController* controller_;
53 49
54 // Stores strong NSImage refs for icons. If an entry is NULL, it will be 50 // Stores strong NSImage refs for icons. If an entry is NULL, it will be
55 // created in GetImageForRow(). 51 // created in GetImageForRow().
56 scoped_nsobject<NSPointerArray> iconImages_; 52 scoped_nsobject<NSPointerArray> iconImages_;
57 53
58 DISALLOW_COPY_AND_ASSIGN(KeywordEditorModelObserver); 54 DISALLOW_COPY_AND_ASSIGN(KeywordEditorModelObserver);
59 }; 55 };
60 56
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 @interface KeywordEditorCocoaController (TestingAPI) 90 @interface KeywordEditorCocoaController (TestingAPI)
95 91
96 // Instances of this class are managed, use +showKeywordEditor:. 92 // Instances of this class are managed, use +showKeywordEditor:.
97 - (id)initWithProfile:(Profile*)profile; 93 - (id)initWithProfile:(Profile*)profile;
98 94
99 // Returns a reference to the shared instance for the given profile, 95 // Returns a reference to the shared instance for the given profile,
100 // or nil if there is none. 96 // or nil if there is none.
101 + (KeywordEditorCocoaController*)sharedInstanceForProfile:(Profile*)profile; 97 + (KeywordEditorCocoaController*)sharedInstanceForProfile:(Profile*)profile;
102 98
103 @end 99 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698