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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 9705097: Revert 127146 - Add Extension Keybinding test for page actions and port the PageAction keybindings … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/views/location_bar/location_bar_view.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
6 6
7 #if defined(TOOLKIT_USES_GTK) 7 #if defined(TOOLKIT_USES_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 for (int i = page_actions.size() - 1; i >= 0; --i) { 1032 for (int i = page_actions.size() - 1; i >= 0; --i) {
1033 page_action_views_[i] = new PageActionWithBadgeView( 1033 page_action_views_[i] = new PageActionWithBadgeView(
1034 delegate_->CreatePageActionImageView(this, page_actions[i])); 1034 delegate_->CreatePageActionImageView(this, page_actions[i]));
1035 page_action_views_[i]->SetVisible(false); 1035 page_action_views_[i]->SetVisible(false);
1036 AddChildViewAt(page_action_views_[i], GetIndexOf(view)); 1036 AddChildViewAt(page_action_views_[i], GetIndexOf(view));
1037 } 1037 }
1038 } 1038 }
1039 1039
1040 WebContents* contents = GetWebContentsFromDelegate(delegate_); 1040 WebContents* contents = GetWebContentsFromDelegate(delegate_);
1041 if (!page_action_views_.empty() && contents) { 1041 if (!page_action_views_.empty() && contents) {
1042 GURL url = browser()->GetSelectedWebContents()->GetURL(); 1042 GURL url = GURL(model_->GetText());
1043 1043
1044 for (PageActionViews::const_iterator i(page_action_views_.begin()); 1044 for (PageActionViews::const_iterator i(page_action_views_.begin());
1045 i != page_action_views_.end(); ++i) { 1045 i != page_action_views_.end(); ++i) {
1046 (*i)->UpdateVisibility(model_->input_in_progress() ? NULL : contents, 1046 (*i)->UpdateVisibility(model_->input_in_progress() ? NULL : contents,
1047 url); 1047 url);
1048 1048
1049 // Check if the visibility of the action changed and notify if it did. 1049 // Check if the visibility of the action changed and notify if it did.
1050 ExtensionAction* action = (*i)->image_view()->page_action(); 1050 ExtensionAction* action = (*i)->image_view()->page_action();
1051 if (old_visibility.find(action) == old_visibility.end() || 1051 if (old_visibility.find(action) == old_visibility.end() ||
1052 old_visibility[action] != (*i)->visible()) { 1052 old_visibility[action] != (*i)->visible()) {
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 !suggested_text_view_->GetText().empty(); 1304 !suggested_text_view_->GetText().empty();
1305 } 1305 }
1306 1306
1307 #if !defined(USE_AURA) 1307 #if !defined(USE_AURA)
1308 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { 1308 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() {
1309 CHECK(!views::Widget::IsPureViews()); 1309 CHECK(!views::Widget::IsPureViews());
1310 return static_cast<OmniboxViewWin*>(location_entry_.get()); 1310 return static_cast<OmniboxViewWin*>(location_entry_.get());
1311 } 1311 }
1312 #endif 1312 #endif
1313 #endif 1313 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698