| 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 #include "ash/ime/infolist_window.h" | 5 #include "ash/ime/infolist_window.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ime/candidate_window_constants.h" | 10 #include "ash/ime/candidate_window_constants.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 const int kInfolistShowDelayMilliSeconds = 500; | 33 const int kInfolistShowDelayMilliSeconds = 500; |
| 34 // The milliseconds of the delay to hide the infolist window. | 34 // The milliseconds of the delay to hide the infolist window. |
| 35 const int kInfolistHideDelayMilliSeconds = 500; | 35 const int kInfolistHideDelayMilliSeconds = 500; |
| 36 | 36 |
| 37 /////////////////////////////////////////////////////////////////////////////// | 37 /////////////////////////////////////////////////////////////////////////////// |
| 38 // InfolistBorder | 38 // InfolistBorder |
| 39 // The BubbleBorder subclass to draw the border and determine its position. | 39 // The BubbleBorder subclass to draw the border and determine its position. |
| 40 class InfolistBorder : public views::BubbleBorder { | 40 class InfolistBorder : public views::BubbleBorder { |
| 41 public: | 41 public: |
| 42 InfolistBorder(); | 42 InfolistBorder(); |
| 43 virtual ~InfolistBorder(); | 43 ~InfolistBorder() override; |
| 44 | 44 |
| 45 // views::BubbleBorder implementation. | 45 // views::BubbleBorder implementation. |
| 46 virtual gfx::Rect GetBounds(const gfx::Rect& anchor_rect, | 46 gfx::Rect GetBounds(const gfx::Rect& anchor_rect, |
| 47 const gfx::Size& contents_size) const override; | 47 const gfx::Size& contents_size) const override; |
| 48 virtual gfx::Insets GetInsets() const override; | 48 gfx::Insets GetInsets() const override; |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 DISALLOW_COPY_AND_ASSIGN(InfolistBorder); | 51 DISALLOW_COPY_AND_ASSIGN(InfolistBorder); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 InfolistBorder::InfolistBorder() | 54 InfolistBorder::InfolistBorder() |
| 55 : views::BubbleBorder(views::BubbleBorder::LEFT_CENTER, | 55 : views::BubbleBorder(views::BubbleBorder::LEFT_CENTER, |
| 56 views::BubbleBorder::NO_SHADOW, | 56 views::BubbleBorder::NO_SHADOW, |
| 57 SK_ColorTRANSPARENT) { | 57 SK_ColorTRANSPARENT) { |
| 58 set_paint_arrow(views::BubbleBorder::PAINT_NONE); | 58 set_paint_arrow(views::BubbleBorder::PAINT_NONE); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace | 83 } // namespace |
| 84 | 84 |
| 85 // InfolistRow renderes a row of a infolist. | 85 // InfolistRow renderes a row of a infolist. |
| 86 class InfolistEntryView : public views::View { | 86 class InfolistEntryView : public views::View { |
| 87 public: | 87 public: |
| 88 InfolistEntryView(const ui::InfolistEntry& entry, | 88 InfolistEntryView(const ui::InfolistEntry& entry, |
| 89 const gfx::FontList& title_font_list, | 89 const gfx::FontList& title_font_list, |
| 90 const gfx::FontList& description_font_list); | 90 const gfx::FontList& description_font_list); |
| 91 virtual ~InfolistEntryView(); | 91 ~InfolistEntryView() override; |
| 92 | 92 |
| 93 void SetEntry(const ui::InfolistEntry& entry); | 93 void SetEntry(const ui::InfolistEntry& entry); |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 // views::View implementation. | 96 // views::View implementation. |
| 97 virtual gfx::Size GetPreferredSize() const override; | 97 gfx::Size GetPreferredSize() const override; |
| 98 | 98 |
| 99 void UpdateBackground(); | 99 void UpdateBackground(); |
| 100 | 100 |
| 101 ui::InfolistEntry entry_; | 101 ui::InfolistEntry entry_; |
| 102 | 102 |
| 103 // The title label. Owned by views hierarchy. | 103 // The title label. Owned by views hierarchy. |
| 104 views::Label* title_label_; | 104 views::Label* title_label_; |
| 105 | 105 |
| 106 // The description label. Owned by views hierarchy. | 106 // The description label. Owned by views hierarchy. |
| 107 views::Label* description_label_; | 107 views::Label* description_label_; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 show_hide_timer_.Stop(); | 271 show_hide_timer_.Stop(); |
| 272 GetWidget()->Close(); | 272 GetWidget()->Close(); |
| 273 } | 273 } |
| 274 | 274 |
| 275 void InfolistWindow::WindowClosing() { | 275 void InfolistWindow::WindowClosing() { |
| 276 show_hide_timer_.Stop(); | 276 show_hide_timer_.Stop(); |
| 277 } | 277 } |
| 278 | 278 |
| 279 } // namespace ime | 279 } // namespace ime |
| 280 } // namespace ash | 280 } // namespace ash |
| OLD | NEW |