| 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 // ui::EventTarget: |
| 54 // Have parent do event handling. | 54 virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE { |
| 55 return false; | 55 return false; |
| 56 } | 56 } |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 // Child views. Not owned. | 59 // Child views. Not owned. |
| 60 views::Label* suggestion_label_; | 60 views::Label* suggestion_label_; |
| 61 views::Label* password_label_; | 61 views::Label* password_label_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(PasswordRow); | 63 DISALLOW_COPY_AND_ASSIGN(PasswordRow); |
| 64 }; | 64 }; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 // If the top level widget can't be found, cancel the popup since we can't | 178 // If the top level widget can't be found, cancel the popup since we can't |
| 179 // fully set it up. | 179 // fully set it up. |
| 180 if (!observing_widget) | 180 if (!observing_widget) |
| 181 return NULL; | 181 return NULL; |
| 182 | 182 |
| 183 return new PasswordGenerationPopupViewViews(controller, observing_widget); | 183 return new PasswordGenerationPopupViewViews(controller, observing_widget); |
| 184 } | 184 } |
| 185 | 185 |
| 186 } // namespace autofill | 186 } // namespace autofill |
| OLD | NEW |