OLD | NEW |
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 |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/scoped_vector.h" | 15 #include "base/memory/scoped_vector.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
18 #include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" | 18 #include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" |
19 #include "chrome/browser/ui/location_bar/location_bar.h" | 19 #include "chrome/browser/ui/location_bar/location_bar.h" |
20 #include "chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.h" | 20 #include "chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.h" |
21 #include "components/content_settings/core/common/content_settings_types.h" | 21 #include "components/content_settings/core/common/content_settings_types.h" |
22 #include "components/prefs/pref_member.h" | 22 #include "components/prefs/pref_member.h" |
23 #include "components/security_state/security_state_model.h" | 23 #include "components/security_state/core/security_state.h" |
24 #include "components/zoom/zoom_event_manager_observer.h" | 24 #include "components/zoom/zoom_event_manager_observer.h" |
25 | 25 |
26 @class AutocompleteTextField; | 26 @class AutocompleteTextField; |
27 class CommandUpdater; | 27 class CommandUpdater; |
28 class ContentSettingDecoration; | 28 class ContentSettingDecoration; |
29 class KeywordHintDecoration; | 29 class KeywordHintDecoration; |
30 class LocationBarDecoration; | 30 class LocationBarDecoration; |
31 class LocationIconDecoration; | 31 class LocationIconDecoration; |
32 class ManagePasswordsDecoration; | 32 class ManagePasswordsDecoration; |
33 class PageActionDecoration; | 33 class PageActionDecoration; |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 void UpdateTranslateDecoration(); | 248 void UpdateTranslateDecoration(); |
249 | 249 |
250 // Updates the zoom decoration in the omnibox with the current zoom level. | 250 // Updates the zoom decoration in the omnibox with the current zoom level. |
251 // Returns whether any updates were made. | 251 // Returns whether any updates were made. |
252 bool UpdateZoomDecoration(bool default_zoom_changed); | 252 bool UpdateZoomDecoration(bool default_zoom_changed); |
253 | 253 |
254 // Updates the security state bubble decoration. | 254 // Updates the security state bubble decoration. |
255 void UpdateSecurityState(bool tab_changed); | 255 void UpdateSecurityState(bool tab_changed); |
256 | 256 |
257 // Returns true if the security state can animate for the |level|. | 257 // Returns true if the security state can animate for the |level|. |
258 bool CanAnimateSecurityLevel( | 258 bool CanAnimateSecurityLevel(security_state::SecurityLevel level) const; |
259 security_state::SecurityStateModel::SecurityLevel level) const; | |
260 | 259 |
261 // Returns true if |level| is SECURE or EV_SECURE. | 260 // Returns true if |level| is SECURE or EV_SECURE. |
262 bool IsSecureConnection( | 261 bool IsSecureConnection(security_state::SecurityLevel level) const; |
263 security_state::SecurityStateModel::SecurityLevel level) const; | |
264 | 262 |
265 // Returns pointers to all of the LocationBarDecorations owned by this | 263 // Returns pointers to all of the LocationBarDecorations owned by this |
266 // LocationBarViewMac. This helper function is used for positioning and | 264 // LocationBarViewMac. This helper function is used for positioning and |
267 // re-positioning accessibility views. | 265 // re-positioning accessibility views. |
268 std::vector<LocationBarDecoration*> GetDecorations(); | 266 std::vector<LocationBarDecoration*> GetDecorations(); |
269 | 267 |
270 // Updates |decoration|'s accessibility view's position to match the computed | 268 // Updates |decoration|'s accessibility view's position to match the computed |
271 // position the decoration will be drawn at. | 269 // position the decoration will be drawn at. |
272 void UpdateAccessibilityViewPosition(LocationBarDecoration* decoration); | 270 void UpdateAccessibilityViewPosition(LocationBarDecoration* decoration); |
273 | 271 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 331 |
334 // True if the security state decoration should be animated for a non-secure | 332 // True if the security state decoration should be animated for a non-secure |
335 // security level. | 333 // security level. |
336 bool should_animate_nonsecure_verbose_; | 334 bool should_animate_nonsecure_verbose_; |
337 | 335 |
338 // True if there's enough room for the omnibox to show the security verbose. | 336 // True if there's enough room for the omnibox to show the security verbose. |
339 // If the verbose is displaying the EV cert, then this should always be true. | 337 // If the verbose is displaying the EV cert, then this should always be true. |
340 bool is_width_available_for_security_verbose_; | 338 bool is_width_available_for_security_verbose_; |
341 | 339 |
342 // The security level of the location bar icon. | 340 // The security level of the location bar icon. |
343 security_state::SecurityStateModel::SecurityLevel security_level_; | 341 security_state::SecurityLevel security_level_; |
344 | 342 |
345 // Used to schedule a task for the first run info bubble. | 343 // Used to schedule a task for the first run info bubble. |
346 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; | 344 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; |
347 | 345 |
348 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); | 346 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); |
349 }; | 347 }; |
350 | 348 |
351 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ | 349 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ |
OLD | NEW |