OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_VIEWS_LOCATION_BAR_ORIGIN_CHIP_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ORIGIN_CHIP_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ORIGIN_CHIP_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ORIGIN_CHIP_VIEW_H_ |
7 | 7 |
8 #include "chrome/browser/safe_browsing/ui_manager.h" | 8 #include "chrome/browser/safe_browsing/ui_manager.h" |
9 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 9 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
10 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 10 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 class OriginChipView : public views::LabelButton, | 33 class OriginChipView : public views::LabelButton, |
34 public views::ButtonListener, | 34 public views::ButtonListener, |
35 public SafeBrowsingUIManager::Observer { | 35 public SafeBrowsingUIManager::Observer { |
36 public: | 36 public: |
37 OriginChipView(LocationBarView* location_bar_view, | 37 OriginChipView(LocationBarView* location_bar_view, |
38 Profile* profile, | 38 Profile* profile, |
39 const gfx::FontList& font_list); | 39 const gfx::FontList& font_list); |
40 virtual ~OriginChipView(); | 40 virtual ~OriginChipView(); |
41 | 41 |
42 // Returns true if the origin chip should be visible. This will always be | |
43 // true if the original origin chip experiment is enabled. If the V2 | |
44 // experiment is enabled this is true if the chip hasn't been hidden by | |
45 // clicking on it or interacting with the Omnibox. | |
46 bool ShouldShow(); | |
47 | |
48 // Recalculates the contents of the Origin Chip based on the displayed tab. | 42 // Recalculates the contents of the Origin Chip based on the displayed tab. |
49 void Update(content::WebContents* tab); | 43 void Update(content::WebContents* tab); |
50 | 44 |
51 // Called to signal that the contents of the tab being shown has changed, so | 45 // Called to signal that the contents of the tab being shown has changed, so |
52 // the origin chip needs to update itself to the new state. | 46 // the origin chip needs to update itself to the new state. |
53 void OnChanged(); | 47 void OnChanged(); |
54 | 48 |
55 views::ImageView* location_icon_view() { | 49 views::ImageView* location_icon_view() { |
56 return location_icon_view_; | 50 return location_icon_view_; |
57 } | 51 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 scoped_ptr<OriginChipExtensionIcon> extension_icon_; | 95 scoped_ptr<OriginChipExtensionIcon> extension_icon_; |
102 GURL url_displayed_; | 96 GURL url_displayed_; |
103 ToolbarModel::SecurityLevel security_level_; | 97 ToolbarModel::SecurityLevel security_level_; |
104 bool url_malware_; | 98 bool url_malware_; |
105 scoped_ptr<gfx::SlideAnimation> fade_in_animation_; | 99 scoped_ptr<gfx::SlideAnimation> fade_in_animation_; |
106 | 100 |
107 DISALLOW_COPY_AND_ASSIGN(OriginChipView); | 101 DISALLOW_COPY_AND_ASSIGN(OriginChipView); |
108 }; | 102 }; |
109 | 103 |
110 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ORIGIN_CHIP_VIEW_H_ | 104 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ORIGIN_CHIP_VIEW_H_ |
OLD | NEW |