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

Side by Side Diff: chrome/browser/ui/omnibox/omnibox_edit_model.cc

Issue 302453002: New animation for the origin chip URL showing/hiding. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test failure by checking for NULL extension Created 6 years, 6 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/omnibox/omnibox_edit_model.h" 5 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 // The following code handles two cases: 515 // The following code handles two cases:
516 // * For HIDE_ON_USER_INPUT and ON_SRP, it hides the chip when user input 516 // * For HIDE_ON_USER_INPUT and ON_SRP, it hides the chip when user input
517 // begins. 517 // begins.
518 // * For HIDE_ON_MOUSE_RELEASE, which only hides the chip on mouse release if 518 // * For HIDE_ON_MOUSE_RELEASE, which only hides the chip on mouse release if
519 // the omnibox is empty, it handles the "omnibox was not empty" case by 519 // the omnibox is empty, it handles the "omnibox was not empty" case by
520 // acting like HIDE_ON_USER_INPUT. 520 // acting like HIDE_ON_USER_INPUT.
521 if (chrome::ShouldDisplayOriginChip() && in_progress) 521 if (chrome::ShouldDisplayOriginChip() && in_progress)
522 controller()->GetToolbarModel()->set_origin_chip_enabled(false); 522 controller()->GetToolbarModel()->set_origin_chip_enabled(false);
523 523
524 controller_->GetToolbarModel()->set_input_in_progress(in_progress); 524 controller_->GetToolbarModel()->set_input_in_progress(in_progress);
525 controller_->EndOriginChipAnimations(true);
525 controller_->Update(NULL); 526 controller_->Update(NULL);
526 527
527 if (user_input_in_progress_ || !in_revert_) 528 if (user_input_in_progress_ || !in_revert_)
528 delegate_->OnInputStateChanged(); 529 delegate_->OnInputStateChanged();
529 } 530 }
530 531
531 void OmniboxEditModel::Revert() { 532 void OmniboxEditModel::Revert() {
532 SetInputInProgress(false); 533 SetInputInProgress(false);
533 paste_state_ = NONE; 534 paste_state_ = NONE;
534 InternalSetUserText(base::string16()); 535 InternalSetUserText(base::string16());
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 // Update state and notify view if the omnibox has focus and the caret 1461 // Update state and notify view if the omnibox has focus and the caret
1461 // visibility changed. 1462 // visibility changed.
1462 const bool was_caret_visible = is_caret_visible(); 1463 const bool was_caret_visible = is_caret_visible();
1463 focus_state_ = state; 1464 focus_state_ = state;
1464 if (focus_state_ != OMNIBOX_FOCUS_NONE && 1465 if (focus_state_ != OMNIBOX_FOCUS_NONE &&
1465 is_caret_visible() != was_caret_visible) 1466 is_caret_visible() != was_caret_visible)
1466 view_->ApplyCaretVisibility(); 1467 view_->ApplyCaretVisibility();
1467 1468
1468 delegate_->OnFocusChanged(focus_state_, reason); 1469 delegate_->OnFocusChanged(focus_state_, reason);
1469 } 1470 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698