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

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

Issue 2091063002: Location bar: make decorations accessible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: first round Created 4 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
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 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 ManagePasswordsDecoration* manage_passwords_decoration() { 194 ManagePasswordsDecoration* manage_passwords_decoration() {
195 return manage_passwords_decoration_.get(); 195 return manage_passwords_decoration_.get();
196 } 196 }
197 197
198 Browser* browser() const { return browser_; } 198 Browser* browser() const { return browser_; }
199 199
200 // ZoomManagerObserver: 200 // ZoomManagerObserver:
201 // Updates the view for the zoom icon when default zoom levels change. 201 // Updates the view for the zoom icon when default zoom levels change.
202 void OnDefaultZoomLevelChanged() override; 202 void OnDefaultZoomLevelChanged() override;
203 203
204 // Returns the decoration accessibility views for all of this
205 // LocationBarViewMac's decorations. The returned NSViews may not have been
206 // positioned yet.
207 std::vector<NSView*> GetDecorationAccessibilityViews();
208
204 private: 209 private:
205 friend ZoomDecorationTest; 210 friend ZoomDecorationTest;
206 211
207 // Posts |notification| to the default notification center. 212 // Posts |notification| to the default notification center.
208 void PostNotification(NSString* notification); 213 void PostNotification(NSString* notification);
209 214
210 // Return the decoration for |page_action|. 215 // Return the decoration for |page_action|.
211 PageActionDecoration* GetPageActionDecoration(ExtensionAction* page_action); 216 PageActionDecoration* GetPageActionDecoration(ExtensionAction* page_action);
212 217
213 // Clear the page-action decorations. 218 // Clear the page-action decorations.
(...skipping 17 matching lines...) Expand all
231 void ShowFirstRunBubbleInternal(); 236 void ShowFirstRunBubbleInternal();
232 237
233 // Updates the translate decoration in the omnibox with the current translate 238 // Updates the translate decoration in the omnibox with the current translate
234 // state. 239 // state.
235 void UpdateTranslateDecoration(); 240 void UpdateTranslateDecoration();
236 241
237 // Updates the zoom decoration in the omnibox with the current zoom level. 242 // Updates the zoom decoration in the omnibox with the current zoom level.
238 // Returns whether any updates were made. 243 // Returns whether any updates were made.
239 bool UpdateZoomDecoration(bool default_zoom_changed); 244 bool UpdateZoomDecoration(bool default_zoom_changed);
240 245
246 // Returns pointers to all of the LocationBarDecorations owned by this
247 // LocationBarViewMac. This helper function is used for positioning and
248 // re-positioning accessibility views.
249 std::vector<LocationBarDecoration*> GetDecorations();
250
251 // Updates |decoration|'s accessibility view's position to match the computed
252 // position the decoration will be drawn at.
253 void UpdateAccessibilityViewPosition(LocationBarDecoration* decoration);
254
241 std::unique_ptr<OmniboxViewMac> omnibox_view_; 255 std::unique_ptr<OmniboxViewMac> omnibox_view_;
242 256
243 AutocompleteTextField* field_; // owned by tab controller 257 AutocompleteTextField* field_; // owned by tab controller
244 258
245 // A decoration that shows an icon to the left of the address. 259 // A decoration that shows an icon to the left of the address.
246 std::unique_ptr<LocationIconDecoration> location_icon_decoration_; 260 std::unique_ptr<LocationIconDecoration> location_icon_decoration_;
247 261
248 // A decoration that shows the keyword-search bubble on the left. 262 // A decoration that shows the keyword-search bubble on the left.
249 std::unique_ptr<SelectedKeywordDecoration> selected_keyword_decoration_; 263 std::unique_ptr<SelectedKeywordDecoration> selected_keyword_decoration_;
250 264
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 // Indicates whether or not the location bar is currently visible. 299 // Indicates whether or not the location bar is currently visible.
286 bool location_bar_visible_; 300 bool location_bar_visible_;
287 301
288 // Used to schedule a task for the first run info bubble. 302 // Used to schedule a task for the first run info bubble.
289 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; 303 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_;
290 304
291 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); 305 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac);
292 }; 306 };
293 307
294 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ 308 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698