| 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 |level| is SECURE or EV_SECURE. | 257 // Returns true if |level| is SECURE or EV_SECURE. |
| 258 bool IsSecureConnection( | 258 bool IsSecureConnection(security_state::SecurityLevel level) const; |
| 259 security_state::SecurityStateModel::SecurityLevel level) const; | |
| 260 | 259 |
| 261 // Returns pointers to all of the LocationBarDecorations owned by this | 260 // Returns pointers to all of the LocationBarDecorations owned by this |
| 262 // LocationBarViewMac. This helper function is used for positioning and | 261 // LocationBarViewMac. This helper function is used for positioning and |
| 263 // re-positioning accessibility views. | 262 // re-positioning accessibility views. |
| 264 std::vector<LocationBarDecoration*> GetDecorations(); | 263 std::vector<LocationBarDecoration*> GetDecorations(); |
| 265 | 264 |
| 266 // Updates |decoration|'s accessibility view's position to match the computed | 265 // Updates |decoration|'s accessibility view's position to match the computed |
| 267 // position the decoration will be drawn at. | 266 // position the decoration will be drawn at. |
| 268 void UpdateAccessibilityViewPosition(LocationBarDecoration* decoration); | 267 void UpdateAccessibilityViewPosition(LocationBarDecoration* decoration); |
| 269 | 268 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 | 328 |
| 330 // True if the security state decoration should be animated for a non-secure | 329 // True if the security state decoration should be animated for a non-secure |
| 331 // security level. | 330 // security level. |
| 332 bool should_animate_nonsecure_verbose_; | 331 bool should_animate_nonsecure_verbose_; |
| 333 | 332 |
| 334 // True if there's enough room for the omnibox to show the security verbose. | 333 // True if there's enough room for the omnibox to show the security verbose. |
| 335 // If the verbose is displaying the EV cert, then this should always be true. | 334 // If the verbose is displaying the EV cert, then this should always be true. |
| 336 bool is_width_available_for_security_verbose_; | 335 bool is_width_available_for_security_verbose_; |
| 337 | 336 |
| 338 // The security level of the location bar icon. | 337 // The security level of the location bar icon. |
| 339 security_state::SecurityStateModel::SecurityLevel security_level_; | 338 security_state::SecurityLevel security_level_; |
| 340 | 339 |
| 341 // Used to schedule a task for the first run info bubble. | 340 // Used to schedule a task for the first run info bubble. |
| 342 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; | 341 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; |
| 343 | 342 |
| 344 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); | 343 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); |
| 345 }; | 344 }; |
| 346 | 345 |
| 347 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ | 346 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ |
| OLD | NEW |