Index: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc |
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc |
index c250f6a73126afefd78dca4ebc4644256e5e261b..9e9e635b43f82151ebe83a77ff6bfd3b0a9ce5b3 100644 |
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc |
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc |
@@ -4,21 +4,18 @@ |
#include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" |
-#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/ui/browser_finder.h" |
#include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" |
#include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
+#include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
#include "chrome/browser/ui/passwords/save_password_refusal_combobox_model.h" |
#include "chrome/browser/ui/views/frame/browser_view.h" |
-#include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
#include "chrome/browser/ui/views/passwords/credentials_item_view.h" |
#include "chrome/browser/ui/views/passwords/manage_password_items_view.h" |
#include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h" |
#include "chrome/grit/generated_resources.h" |
-#include "content/public/browser/notification_source.h" |
#include "content/public/browser/render_view_host.h" |
-#include "content/public/browser/web_contents.h" |
#include "ui/base/l10n/l10n_util.h" |
#include "ui/base/resource/resource_bundle.h" |
#include "ui/views/controls/button/blue_button.h" |
@@ -989,9 +986,7 @@ ManagePasswordsBubbleView::ManagePasswordsBubbleView( |
ManagePasswordsIconView* anchor_view, |
DisplayReason reason) |
: ManagePasswordsBubble(web_contents, reason), |
- BubbleDelegateView(anchor_view, |
- anchor_view ? views::BubbleBorder::TOP_RIGHT |
- : views::BubbleBorder::NONE), |
+ ManagedFullScreenBubbleDelegateView(anchor_view, web_contents), |
anchor_view_(anchor_view), |
initially_focused_view_(NULL) { |
// Compensate for built-in vertical padding in the anchor view's image. |
@@ -999,13 +994,6 @@ ManagePasswordsBubbleView::ManagePasswordsBubbleView( |
if (anchor_view) |
anchor_view->SetActive(true); |
mouse_handler_.reset(new WebContentMouseHandler(this)); |
- |
- // Add observers to close the bubble if the fullscreen state changes. |
- Browser* browser = chrome::FindBrowserWithWebContents(web_contents); |
- registrar_.Add( |
- this, |
- chrome::NOTIFICATION_FULLSCREEN_CHANGED, |
- content::Source<FullscreenController>(browser->fullscreen_controller())); |
} |
ManagePasswordsBubbleView::~ManagePasswordsBubbleView() { |
@@ -1013,20 +1001,6 @@ ManagePasswordsBubbleView::~ManagePasswordsBubbleView() { |
anchor_view_->SetActive(false); |
} |
-void ManagePasswordsBubbleView::AdjustForFullscreen( |
- const gfx::Rect& screen_bounds) { |
- if (GetAnchorView()) |
- return; |
- |
- // The bubble's padding from the screen edge, used in fullscreen. |
- const int kFullscreenPaddingEnd = 20; |
- const size_t bubble_half_width = width() / 2; |
- const int x_pos = base::i18n::IsRTL() ? |
- screen_bounds.x() + bubble_half_width + kFullscreenPaddingEnd : |
- screen_bounds.right() - bubble_half_width - kFullscreenPaddingEnd; |
- SetAnchorRect(gfx::Rect(x_pos, screen_bounds.y(), 0, 0)); |
-} |
- |
void ManagePasswordsBubbleView::Close() { |
mouse_handler_.reset(); |
GetWidget()->Close(); |
Peter Kasting
2014/12/19 22:11:36
Nit: Same comment as in other class
Pritam Nikam
2014/12/22 08:19:10
Done.
|
@@ -1098,12 +1072,3 @@ void ManagePasswordsBubbleView::WindowClosing() { |
views::View* ManagePasswordsBubbleView::GetInitiallyFocusedView() { |
return initially_focused_view_; |
} |
- |
-void ManagePasswordsBubbleView::Observe( |
- int type, |
- const content::NotificationSource& source, |
- const content::NotificationDetails& details) { |
- DCHECK_EQ(type, chrome::NOTIFICATION_FULLSCREEN_CHANGED); |
- GetWidget()->SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE); |
- CloseBubble(); |
-} |