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

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

Issue 373043003: Password bubble: Don't focus by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback Created 6 years, 5 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 "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_finder.h" 9 #include "chrome/browser/ui/browser_finder.h"
10 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 parent_->Close(); 427 parent_->Close();
428 } 428 }
429 429
430 // ManagePasswordsBubbleView -------------------------------------------------- 430 // ManagePasswordsBubbleView --------------------------------------------------
431 431
432 // static 432 // static
433 ManagePasswordsBubbleView* ManagePasswordsBubbleView::manage_passwords_bubble_ = 433 ManagePasswordsBubbleView* ManagePasswordsBubbleView::manage_passwords_bubble_ =
434 NULL; 434 NULL;
435 435
436 // static 436 // static
437 const ManagePasswordsBubbleView* ManagePasswordsBubbleView::Bubble() {
438 return ManagePasswordsBubbleView::manage_passwords_bubble_;
439 }
440
441 // static
437 void ManagePasswordsBubbleView::ShowBubble(content::WebContents* web_contents, 442 void ManagePasswordsBubbleView::ShowBubble(content::WebContents* web_contents,
438 DisplayReason reason) { 443 DisplayReason reason) {
439 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); 444 Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
440 DCHECK(browser); 445 DCHECK(browser);
441 DCHECK(browser->window()); 446 DCHECK(browser->window());
442 DCHECK(browser->fullscreen_controller()); 447 DCHECK(browser->fullscreen_controller());
443 448
444 if (IsShowing()) 449 if (IsShowing())
445 return; 450 return;
446 451
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 ManagePasswordsIconView* anchor_view, 492 ManagePasswordsIconView* anchor_view,
488 DisplayReason reason) 493 DisplayReason reason)
489 : ManagePasswordsBubble(web_contents, reason), 494 : ManagePasswordsBubble(web_contents, reason),
490 BubbleDelegateView(anchor_view, 495 BubbleDelegateView(anchor_view,
491 anchor_view ? views::BubbleBorder::TOP_RIGHT 496 anchor_view ? views::BubbleBorder::TOP_RIGHT
492 : views::BubbleBorder::NONE), 497 : views::BubbleBorder::NONE),
493 anchor_view_(anchor_view), 498 anchor_view_(anchor_view),
494 never_save_passwords_(false) { 499 never_save_passwords_(false) {
495 // Compensate for built-in vertical padding in the anchor view's image. 500 // Compensate for built-in vertical padding in the anchor view's image.
496 set_anchor_view_insets(gfx::Insets(2, 0, 2, 0)); 501 set_anchor_view_insets(gfx::Insets(2, 0, 2, 0));
497 set_notify_enter_exit_on_child(true); 502 // Don't focus by default.
503 set_use_focusless(true);
498 if (anchor_view) 504 if (anchor_view)
499 anchor_view->SetActive(true); 505 anchor_view->SetActive(true);
500 } 506 }
501 507
502 ManagePasswordsBubbleView::~ManagePasswordsBubbleView() { 508 ManagePasswordsBubbleView::~ManagePasswordsBubbleView() {
503 if (anchor_view_) 509 if (anchor_view_)
504 anchor_view_->SetActive(false); 510 anchor_view_->SetActive(false);
505 } 511 }
506 512
507 void ManagePasswordsBubbleView::AdjustForFullscreen( 513 void ManagePasswordsBubbleView::AdjustForFullscreen(
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 570
565 void ManagePasswordsBubbleView::NotifyConfirmedNeverForThisSite() { 571 void ManagePasswordsBubbleView::NotifyConfirmedNeverForThisSite() {
566 model()->OnNeverForThisSiteClicked(); 572 model()->OnNeverForThisSiteClicked();
567 Close(); 573 Close();
568 } 574 }
569 575
570 void ManagePasswordsBubbleView::NotifyUndoNeverForThisSite() { 576 void ManagePasswordsBubbleView::NotifyUndoNeverForThisSite() {
571 never_save_passwords_ = false; 577 never_save_passwords_ = false;
572 Refresh(); 578 Refresh();
573 } 579 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698