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

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

Issue 9693047: Add Extension Keybinding test for page actions. This is to facilitate an upcoming port of the PageA… (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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 for (int i = page_actions.size() - 1; i >= 0; --i) { 1034 for (int i = page_actions.size() - 1; i >= 0; --i) {
1035 page_action_views_[i] = new PageActionWithBadgeView( 1035 page_action_views_[i] = new PageActionWithBadgeView(
1036 new PageActionImageView(this, page_actions[i])); 1036 new PageActionImageView(this, page_actions[i]));
1037 page_action_views_[i]->SetVisible(false); 1037 page_action_views_[i]->SetVisible(false);
1038 AddChildViewAt(page_action_views_[i], GetIndexOf(view)); 1038 AddChildViewAt(page_action_views_[i], GetIndexOf(view));
1039 } 1039 }
1040 } 1040 }
1041 1041
1042 WebContents* contents = GetWebContentsFromDelegate(delegate_); 1042 WebContents* contents = GetWebContentsFromDelegate(delegate_);
1043 if (!page_action_views_.empty() && contents) { 1043 if (!page_action_views_.empty() && contents) {
1044 GURL url = GURL(model_->GetText()); 1044 GURL url = browser()->GetSelectedWebContents()->GetURL();
1045 1045
1046 for (PageActionViews::const_iterator i(page_action_views_.begin()); 1046 for (PageActionViews::const_iterator i(page_action_views_.begin());
1047 i != page_action_views_.end(); ++i) { 1047 i != page_action_views_.end(); ++i) {
1048 (*i)->UpdateVisibility(model_->input_in_progress() ? NULL : contents, 1048 (*i)->UpdateVisibility(model_->input_in_progress() ? NULL : contents,
1049 url); 1049 url);
1050 1050
1051 // Check if the visibility of the action changed and notify if it did. 1051 // Check if the visibility of the action changed and notify if it did.
1052 ExtensionAction* action = (*i)->image_view()->page_action(); 1052 ExtensionAction* action = (*i)->image_view()->page_action();
1053 if (old_visibility.find(action) == old_visibility.end() || 1053 if (old_visibility.find(action) == old_visibility.end() ||
1054 old_visibility[action] != (*i)->visible()) { 1054 old_visibility[action] != (*i)->visible()) {
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 !suggested_text_view_->GetText().empty(); 1306 !suggested_text_view_->GetText().empty();
1307 } 1307 }
1308 1308
1309 #if !defined(USE_AURA) 1309 #if !defined(USE_AURA)
1310 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { 1310 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() {
1311 CHECK(!views::Widget::IsPureViews()); 1311 CHECK(!views::Widget::IsPureViews());
1312 return static_cast<OmniboxViewWin*>(location_entry_.get()); 1312 return static_cast<OmniboxViewWin*>(location_entry_.get());
1313 } 1313 }
1314 #endif 1314 #endif
1315 #endif 1315 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698