OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_TOOLBAR_SITE_CHIP_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_SITE_CHIP_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_SITE_CHIP_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_SITE_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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // the site chip needs to update itself to the new state. | 49 // the site chip needs to update itself to the new state. |
50 void OnChanged(); | 50 void OnChanged(); |
51 | 51 |
52 views::ImageView* location_icon_view() { | 52 views::ImageView* location_icon_view() { |
53 return location_icon_view_; | 53 return location_icon_view_; |
54 } | 54 } |
55 const views::ImageView* location_icon_view() const { | 55 const views::ImageView* location_icon_view() const { |
56 return location_icon_view_; | 56 return location_icon_view_; |
57 } | 57 } |
58 | 58 |
| 59 // Elides the hostname shown to the indicated width, if needed. Returns the |
| 60 // final width of the site chip. Note: this may be more than the target width, |
| 61 // since the hostname will not be elided past the TLD+1. |
| 62 int ElideDomainTarget(int target_max_width); |
| 63 |
59 // ToolbarButton: | 64 // ToolbarButton: |
60 virtual gfx::Size GetPreferredSize() OVERRIDE; | 65 virtual gfx::Size GetPreferredSize() OVERRIDE; |
61 virtual void Layout() OVERRIDE; | 66 virtual void Layout() OVERRIDE; |
62 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 67 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
63 | 68 |
64 // views::ButtonListener: | 69 // views::ButtonListener: |
65 virtual void ButtonPressed(views::Button* sender, | 70 virtual void ButtonPressed(views::Button* sender, |
66 const ui::Event& event) OVERRIDE; | 71 const ui::Event& event) OVERRIDE; |
67 | 72 |
68 // views::DragController: | 73 // views::DragController: |
(...skipping 27 matching lines...) Expand all Loading... |
96 bool showing_16x16_icon_; | 101 bool showing_16x16_icon_; |
97 scoped_ptr<SiteChipExtensionIcon> extension_icon_; | 102 scoped_ptr<SiteChipExtensionIcon> extension_icon_; |
98 GURL url_displayed_; | 103 GURL url_displayed_; |
99 ToolbarModel::SecurityLevel security_level_; | 104 ToolbarModel::SecurityLevel security_level_; |
100 bool url_malware_; | 105 bool url_malware_; |
101 | 106 |
102 DISALLOW_COPY_AND_ASSIGN(SiteChipView); | 107 DISALLOW_COPY_AND_ASSIGN(SiteChipView); |
103 }; | 108 }; |
104 | 109 |
105 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_SITE_CHIP_VIEW_H_ | 110 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_SITE_CHIP_VIEW_H_ |
OLD | NEW |