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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_view_win.cc

Issue 10580039: Adds ability to render omnibox as a view above the page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows Created 8 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 (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/omnibox/omnibox_view_win.h" 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <locale> 8 #include <locale>
9 #include <string> 9 #include <string>
10 10
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 // to set offsets. 431 // to set offsets.
432 const int kTwipsPerInch = 1440; 432 const int kTwipsPerInch = 1440;
433 433
434 } // namespace 434 } // namespace
435 435
436 OmniboxViewWin::OmniboxViewWin(AutocompleteEditController* controller, 436 OmniboxViewWin::OmniboxViewWin(AutocompleteEditController* controller,
437 ToolbarModel* toolbar_model, 437 ToolbarModel* toolbar_model,
438 LocationBarView* parent_view, 438 LocationBarView* parent_view,
439 CommandUpdater* command_updater, 439 CommandUpdater* command_updater,
440 bool popup_window_mode, 440 bool popup_window_mode,
441 views::View* location_bar) 441 views::View* location_bar,
442 views::View* popup_parent_view)
442 : model_(new AutocompleteEditModel(this, controller, 443 : model_(new AutocompleteEditModel(this, controller,
443 parent_view->profile())), 444 parent_view->profile())),
444 popup_view_(OmniboxPopupContentsView::CreateForEnvironment( 445 popup_view_(OmniboxPopupContentsView::Create(
445 parent_view->font(), this, model_.get(), location_bar)), 446 parent_view->font(), this, model_.get(), location_bar,
447 popup_parent_view)),
446 controller_(controller), 448 controller_(controller),
447 parent_view_(parent_view), 449 parent_view_(parent_view),
448 toolbar_model_(toolbar_model), 450 toolbar_model_(toolbar_model),
449 command_updater_(command_updater), 451 command_updater_(command_updater),
450 popup_window_mode_(popup_window_mode), 452 popup_window_mode_(popup_window_mode),
451 force_hidden_(false), 453 force_hidden_(false),
452 tracking_click_(), 454 tracking_click_(),
453 tracking_double_click_(false), 455 tracking_double_click_(false),
454 double_click_time_(0), 456 double_click_time_(0),
455 can_discard_mousemove_(false), 457 can_discard_mousemove_(false),
(...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after
2673 // PosFromChar(i) might return 0 when i is greater than 1. 2675 // PosFromChar(i) might return 0 when i is greater than 1.
2674 return font_.GetStringWidth(text) + GetHorizontalMargin(); 2676 return font_.GetStringWidth(text) + GetHorizontalMargin();
2675 } 2677 }
2676 2678
2677 bool OmniboxViewWin::IsCaretAtEnd() const { 2679 bool OmniboxViewWin::IsCaretAtEnd() const {
2678 long length = GetTextLength(); 2680 long length = GetTextLength();
2679 CHARRANGE sel; 2681 CHARRANGE sel;
2680 GetSelection(sel); 2682 GetSelection(sel);
2681 return sel.cpMin == sel.cpMax && sel.cpMin == length; 2683 return sel.cpMin == sel.cpMax && sel.cpMin == length;
2682 } 2684 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698