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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 |
78 // Globals -------------------------------------------------------------------- | |
79 | |
80 namespace chrome { | |
81 | |
82 // Defined in 'chrome/browser/ui/browser_dialogs.h'. | |
Peter Kasting
2014/04/28 20:07:15
Nit: I'd omit this; if you want to keep it, change
| |
83 void ShowManagePasswordsBubble(content::WebContents* web_contents) { | |
84 ManagePasswordsBubbleUIController* controller = | |
85 ManagePasswordsBubbleUIController::FromWebContents(web_contents); | |
86 ManagePasswordsBubbleView::ShowBubble( | |
87 web_contents, | |
88 controller->manage_passwords_bubble_needs_showing() | |
89 ? ManagePasswordsBubbleView::AUTOMATIC | |
90 : ManagePasswordsBubbleView::USER_ACTION); | |
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 |