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

Unified Diff: chrome/browser/ui/omnibox/omnibox_edit_controller.cc

Issue 200783003: [OriginChip] Add animations for the hiding and showing of the chip. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to comments, merge Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/omnibox/omnibox_edit_controller.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_edit_controller.cc b/chrome/browser/ui/omnibox/omnibox_edit_controller.cc
index 43987fcc40156c698d1c6f36b89892d8ecff8293..0d2c22a9f485589b07d7381f1927bcc9180872a9 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_controller.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_controller.cc
@@ -6,6 +6,7 @@
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/command_updater.h"
+#include "chrome/browser/ui/toolbar/toolbar_model.h"
void OmniboxEditController::OnAutocompleteAccept(
const GURL& destination_url,
@@ -26,5 +27,19 @@ OmniboxEditController::OmniboxEditController(CommandUpdater* command_updater)
content::PAGE_TRANSITION_FROM_ADDRESS_BAR)) {
}
+void OmniboxEditController::HideOriginChip() {
+ GetToolbarModel()->set_origin_chip_enabled(false);
+ OnChanged();
+}
+
+void OmniboxEditController::ShowOriginChip() {
+ if (GetToolbarModel()->url_replacement_enabled()) {
Peter Kasting 2014/03/21 21:22:10 I'm not really clear on what this conditional is d
Justin Donnelly 2014/03/24 22:59:37 This handles the two states we end up in after eit
+ GetToolbarModel()->set_origin_chip_enabled(true);
+ OnChanged();
+ } else {
+ HideURL();
+ }
+}
+
OmniboxEditController::~OmniboxEditController() {
}

Powered by Google App Engine
This is Rietveld 408576698