Chromium Code Reviews| 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 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" | 5 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
| 11 #include "chrome/browser/ui/browser_window.h" | 11 #include "chrome/browser/ui/browser_window.h" |
| 12 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" | 12 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
| 13 #include "chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h" | |
| 13 #include "chrome/browser/ui/views/frame/browser_view.h" | 14 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 14 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 15 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 15 #include "chrome/browser/ui/views/passwords/manage_password_item_view.h" | 16 #include "chrome/browser/ui/views/passwords/manage_password_item_view.h" |
| 16 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h" | 17 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h" |
| 17 #include "content/public/browser/notification_source.h" | 18 #include "content/public/browser/notification_source.h" |
| 18 #include "content/public/browser/web_contents_view.h" | 19 #include "content/public/browser/web_contents_view.h" |
| 19 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
| 20 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
| 21 #include "ui/base/models/combobox_model.h" | 22 #include "ui/base/models/combobox_model.h" |
| 22 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 return items_[index].empty(); | 67 return items_[index].empty(); |
| 67 } | 68 } |
| 68 virtual int GetDefaultIndex() const OVERRIDE { return 0; } | 69 virtual int GetDefaultIndex() const OVERRIDE { return 0; } |
| 69 | 70 |
| 70 std::vector<base::string16> items_; | 71 std::vector<base::string16> items_; |
| 71 | 72 |
| 72 DISALLOW_COPY_AND_ASSIGN(SavePasswordRefusalComboboxModel); | 73 DISALLOW_COPY_AND_ASSIGN(SavePasswordRefusalComboboxModel); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 } // namespace | 76 } // namespace |
| 76 | 77 |
|
Peter Kasting
2014/04/25 22:12:02
Nit: One more newline here, and above the "ManageP
Mike West
2014/04/28 10:52:56
Done.
Peter Kasting
2014/04/28 20:07:14
Doesn't look like this actually happened.
| |
| 78 // browser_dialog ------------------------------------------------------------- | |
|
vabr (Chromium)
2014/04/25 15:26:17
nit: This is not entirely clear to me -- it does n
Peter Kasting
2014/04/25 22:12:02
I'd probably call the divider "Globals" instead.
Mike West
2014/04/28 10:52:56
Done.
| |
| 79 | |
| 80 namespace chrome { | |
| 81 | |
| 82 void ShowManagePasswordsBubble(content::WebContents* web_contents) { | |
| 83 ManagePasswordsBubbleUIController* controller = | |
|
Peter Kasting
2014/04/25 22:12:02
Nit: Whole function should be indented 2, not 4
Mike West
2014/04/28 10:52:56
Done.
| |
| 84 ManagePasswordsBubbleUIController::FromWebContents(web_contents); | |
| 85 bool is_automatic_display = | |
| 86 controller->manage_passwords_bubble_needs_showing(); | |
| 87 ManagePasswordsBubbleView::ShowBubble( | |
| 88 web_contents, | |
| 89 is_automatic_display ? ManagePasswordsBubbleView::AUTOMATIC | |
| 90 : ManagePasswordsBubbleView::USER_ACTION); | |
|
Peter Kasting
2014/04/25 22:12:02
Nit: Wrap/indent like:
ManagePasswordsBubbleVie
Mike West
2014/04/28 10:52:56
Done.
Peter Kasting
2014/04/28 20:07:14
The wrapping is still wrong here. Operators go on
| |
| 91 } | |
| 92 | |
| 93 } // namespace chrome | |
| 77 | 94 |
| 78 // ManagePasswordsBubbleView -------------------------------------------------- | 95 // ManagePasswordsBubbleView -------------------------------------------------- |
| 79 | 96 |
| 80 // static | 97 // static |
| 81 ManagePasswordsBubbleView* ManagePasswordsBubbleView::manage_passwords_bubble_ = | 98 ManagePasswordsBubbleView* ManagePasswordsBubbleView::manage_passwords_bubble_ = |
| 82 NULL; | 99 NULL; |
| 83 | 100 |
| 84 // static | 101 // static |
| 85 void ManagePasswordsBubbleView::ShowBubble(content::WebContents* web_contents, | 102 void ManagePasswordsBubbleView::ShowBubble(content::WebContents* web_contents, |
| 86 DisplayReason reason) { | 103 DisplayReason reason) { |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 362 break; | 379 break; |
| 363 case SavePasswordRefusalComboboxModel::INDEX_NEVER_FOR_THIS_SITE: | 380 case SavePasswordRefusalComboboxModel::INDEX_NEVER_FOR_THIS_SITE: |
| 364 model()->OnNeverForThisSiteClicked(); | 381 model()->OnNeverForThisSiteClicked(); |
| 365 break; | 382 break; |
| 366 default: | 383 default: |
| 367 NOTREACHED(); | 384 NOTREACHED(); |
| 368 break; | 385 break; |
| 369 } | 386 } |
| 370 Close(); | 387 Close(); |
| 371 } | 388 } |
| OLD | NEW |