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

Unified Diff: chrome/browser/ui/views/find_bar_view.cc

Issue 2441863002: Remove some more !IsModeMaterial code. (Closed)
Patch Set: restore Created 4 years, 2 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
« no previous file with comments | « chrome/browser/ui/views/find_bar_view.h ('k') | chrome/browser/ui/views/frame/browser_header_painter_ash.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/find_bar_view.cc
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc
index d426235dc2df94b557a51e9d37b240651a2a3a8e..bedf469e44a51fedf352d119db20d79b148c55f5 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -111,7 +111,7 @@ class FocusForwarderView : public views::View {
// FindBarView, public:
FindBarView::FindBarView(FindBarHost* host)
- : DropdownBarView(host),
+ : find_bar_host_(host),
find_text_(new views::Textfield),
match_count_text_(new MatchCountLabel()),
focus_forwarder_view_(new FocusForwarderView(find_text_)),
@@ -243,13 +243,6 @@ void FindBarView::ClearMatchCount() {
SchedulePaint();
}
-void FindBarView::SetFocusAndSelection(bool select_all) {
- find_text_->RequestFocus();
- GetWidget()->GetInputMethod()->ShowImeIfNeeded();
- if (select_all && !find_text_->text().empty())
- find_text_->SelectAll(true);
-}
-
///////////////////////////////////////////////////////////////////////////////
// FindBarView, views::View overrides:
@@ -276,6 +269,16 @@ gfx::Size FindBarView::GetPreferredSize() const {
}
////////////////////////////////////////////////////////////////////////////////
+// FindBarView, DropdownBarHostDelegate implementation:
+
+void FindBarView::SetFocusAndSelection(bool select_all) {
+ find_text_->RequestFocus();
+ GetWidget()->GetInputMethod()->ShowImeIfNeeded();
+ if (select_all && !find_text_->text().empty())
+ find_text_->SelectAll(true);
+}
+
+////////////////////////////////////////////////////////////////////////////////
// FindBarView, views::VectorIconButtonDelegate implementation:
void FindBarView::ButtonPressed(
@@ -285,7 +288,7 @@ void FindBarView::ButtonPressed(
case VIEW_ID_FIND_IN_PAGE_NEXT_BUTTON:
if (!find_text_->text().empty()) {
FindTabHelper* find_tab_helper = FindTabHelper::FromWebContents(
- find_bar_host()->GetFindBarController()->web_contents());
+ find_bar_host_->GetFindBarController()->web_contents());
find_tab_helper->StartFinding(
find_text_->text(),
sender->id() == VIEW_ID_FIND_IN_PAGE_NEXT_BUTTON,
@@ -293,7 +296,7 @@ void FindBarView::ButtonPressed(
}
break;
case VIEW_ID_FIND_IN_PAGE_CLOSE_BUTTON:
- find_bar_host()->GetFindBarController()->EndFindSession(
+ find_bar_host_->GetFindBarController()->EndFindSession(
FindBarController::kKeepSelectionOnPage,
FindBarController::kKeepResultsInFindBox);
break;
@@ -314,10 +317,10 @@ SkColor FindBarView::GetVectorIconBaseColor() const {
bool FindBarView::HandleKeyEvent(views::Textfield* sender,
const ui::KeyEvent& key_event) {
// If the dialog is not visible, there is no reason to process keyboard input.
- if (!host()->IsVisible())
+ if (!find_bar_host_->IsVisible())
return false;
- if (find_bar_host()->MaybeForwardKeyEventToWebpage(key_event))
+ if (find_bar_host_->MaybeForwardKeyEventToWebpage(key_event))
return true; // Handled, we are done!
if (key_event.key_code() == ui::VKEY_RETURN &&
@@ -325,7 +328,7 @@ bool FindBarView::HandleKeyEvent(views::Textfield* sender,
// Pressing Return/Enter starts the search (unless text box is empty).
base::string16 find_string = find_text_->text();
if (!find_string.empty()) {
- FindBarController* controller = find_bar_host()->GetFindBarController();
+ FindBarController* controller = find_bar_host_->GetFindBarController();
FindTabHelper* find_tab_helper =
FindTabHelper::FromWebContents(controller->web_contents());
// Search forwards for enter, backwards for shift-enter.
@@ -359,7 +362,7 @@ views::View* FindBarView::TargetForRect(View* root, const gfx::Rect& rect) {
}
void FindBarView::Find(const base::string16& search_text) {
- FindBarController* controller = find_bar_host()->GetFindBarController();
+ FindBarController* controller = find_bar_host_->GetFindBarController();
DCHECK(controller);
content::WebContents* web_contents = controller->web_contents();
// We must guard against a NULL web_contents, which can happen if the text
@@ -380,7 +383,7 @@ void FindBarView::Find(const base::string16& search_text) {
} else {
find_tab_helper->StopFinding(FindBarController::kClearSelectionOnPage);
UpdateForResult(find_tab_helper->find_result(), base::string16());
- find_bar_host()->MoveWindowIfNecessary(gfx::Rect());
+ find_bar_host_->MoveWindowIfNecessary(gfx::Rect());
// Clearing the text box should clear the prepopulate state so that when
// we close and reopen the Find box it doesn't show the search we just
@@ -400,10 +403,6 @@ void FindBarView::UpdateMatchCountAppearance(bool no_match) {
find_next_button_->SetEnabled(enable_buttons);
}
-FindBarHost* FindBarView::find_bar_host() const {
- return static_cast<FindBarHost*>(host());
-}
-
const char* FindBarView::GetClassName() const {
return "FindBarView";
}
« no previous file with comments | « chrome/browser/ui/views/find_bar_view.h ('k') | chrome/browser/ui/views/frame/browser_header_painter_ash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698