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 "chrome/browser/ui/views/autofill/password_generation_popup_view_views.
h" | 5 #include "chrome/browser/ui/views/autofill/password_generation_popup_view_views.
h" |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "chrome/browser/ui/autofill/password_generation_popup_controller.h" | 8 #include "chrome/browser/ui/autofill/password_generation_popup_controller.h" |
9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
10 #include "ui/views/background.h" | 10 #include "ui/views/background.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 AddChildView(password_label_); | 43 AddChildView(password_label_); |
44 | 44 |
45 suggestion_label_ = new views::Label(suggestion, font_list); | 45 suggestion_label_ = new views::Label(suggestion, font_list); |
46 suggestion_label_->SetHorizontalAlignment(gfx::ALIGN_RIGHT); | 46 suggestion_label_->SetHorizontalAlignment(gfx::ALIGN_RIGHT); |
47 suggestion_label_->SetEnabledColor( | 47 suggestion_label_->SetEnabledColor( |
48 PasswordGenerationPopupView::kExplanatoryTextColor); | 48 PasswordGenerationPopupView::kExplanatoryTextColor); |
49 AddChildView(suggestion_label_); | 49 AddChildView(suggestion_label_); |
50 } | 50 } |
51 virtual ~PasswordRow() {} | 51 virtual ~PasswordRow() {} |
52 | 52 |
53 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE { | 53 // views::View: |
54 // Have parent do event handling. | 54 virtual bool CanProcessEventsWithinSubtree() const OVERRIDE { |
| 55 // Send events to the parent view for handling. |
55 return false; | 56 return false; |
56 } | 57 } |
57 | 58 |
58 private: | 59 private: |
59 // Child views. Not owned. | 60 // Child views. Not owned. |
60 views::Label* suggestion_label_; | 61 views::Label* suggestion_label_; |
61 views::Label* password_label_; | 62 views::Label* password_label_; |
62 | 63 |
63 DISALLOW_COPY_AND_ASSIGN(PasswordRow); | 64 DISALLOW_COPY_AND_ASSIGN(PasswordRow); |
64 }; | 65 }; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 178 |
178 // If the top level widget can't be found, cancel the popup since we can't | 179 // If the top level widget can't be found, cancel the popup since we can't |
179 // fully set it up. | 180 // fully set it up. |
180 if (!observing_widget) | 181 if (!observing_widget) |
181 return NULL; | 182 return NULL; |
182 | 183 |
183 return new PasswordGenerationPopupViewViews(controller, observing_widget); | 184 return new PasswordGenerationPopupViewViews(controller, observing_widget); |
184 } | 185 } |
185 | 186 |
186 } // namespace autofill | 187 } // namespace autofill |
OLD | NEW |