Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc

Issue 250353003: Password bubble: refactor ManagePasswordsIconView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/cc/h Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 ManagePasswordsBubbleView* ManagePasswordsBubbleView::manage_passwords_bubble_ = 81 ManagePasswordsBubbleView* ManagePasswordsBubbleView::manage_passwords_bubble_ =
82 NULL; 82 NULL;
83 83
84 // static 84 // static
85 void ManagePasswordsBubbleView::ShowBubble(content::WebContents* web_contents, 85 void ManagePasswordsBubbleView::ShowBubble(content::WebContents* web_contents,
86 DisplayReason reason) { 86 DisplayReason reason) {
87 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); 87 Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
88 DCHECK(browser); 88 DCHECK(browser);
89 DCHECK(browser->window()); 89 DCHECK(browser->window());
90 DCHECK(browser->fullscreen_controller()); 90 DCHECK(browser->fullscreen_controller());
91 DCHECK(!IsShowing()); 91
92 if (IsShowing())
93 return;
92 94
93 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser); 95 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser);
94 bool is_fullscreen = browser_view->IsFullscreen(); 96 bool is_fullscreen = browser_view->IsFullscreen();
95 views::View* anchor_view = is_fullscreen ? 97 views::View* anchor_view = is_fullscreen ?
96 NULL : browser_view->GetLocationBarView()->manage_passwords_icon_view(); 98 NULL : browser_view->GetLocationBarView()->manage_passwords_icon_view();
97 manage_passwords_bubble_ = new ManagePasswordsBubbleView( 99 manage_passwords_bubble_ = new ManagePasswordsBubbleView(
98 web_contents, anchor_view, reason); 100 web_contents, anchor_view, reason);
99 101
100 if (is_fullscreen) { 102 if (is_fullscreen) {
101 manage_passwords_bubble_->set_parent_window( 103 manage_passwords_bubble_->set_parent_window(
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 break; 362 break;
361 case SavePasswordRefusalComboboxModel::INDEX_NEVER_FOR_THIS_SITE: 363 case SavePasswordRefusalComboboxModel::INDEX_NEVER_FOR_THIS_SITE:
362 model()->OnNeverForThisSiteClicked(); 364 model()->OnNeverForThisSiteClicked();
363 break; 365 break;
364 default: 366 default:
365 NOTREACHED(); 367 NOTREACHED();
366 break; 368 break;
367 } 369 }
368 Close(); 370 Close();
369 } 371 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698