OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/autocomplete/autocomplete_edit_view_win.h" | 5 #include "chrome/browser/autocomplete/autocomplete_edit_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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 CHARRANGE selection; | 504 CHARRANGE selection; |
505 GetSelection(selection); | 505 GetSelection(selection); |
506 GetStateAccessor()->SetProperty(tab->property_bag(), | 506 GetStateAccessor()->SetProperty(tab->property_bag(), |
507 AutocompleteEditState( | 507 AutocompleteEditState( |
508 model_state, | 508 model_state, |
509 State(selection, saved_selection_for_focus_change_))); | 509 State(selection, saved_selection_for_focus_change_))); |
510 } | 510 } |
511 | 511 |
512 void AutocompleteEditViewWin::Update( | 512 void AutocompleteEditViewWin::Update( |
513 const TabContents* tab_for_state_restoring) { | 513 const TabContents* tab_for_state_restoring) { |
514 // If we're switching to a tab with a collapsed toolbar, bail | |
515 // now, since we won't be showing the Omnibox anyway, and | |
516 // executing the code below just results in a flicker before | |
517 // the toolbar hides. | |
518 if (tab_for_state_restoring && tab_for_state_restoring->is_app()) | |
519 return; | |
520 | |
521 const bool visibly_changed_permanent_text = | 514 const bool visibly_changed_permanent_text = |
522 model_->UpdatePermanentText(toolbar_model_->GetText()); | 515 model_->UpdatePermanentText(toolbar_model_->GetText()); |
523 | 516 |
524 const ToolbarModel::SecurityLevel security_level = | 517 const ToolbarModel::SecurityLevel security_level = |
525 toolbar_model_->GetSecurityLevel(); | 518 toolbar_model_->GetSecurityLevel(); |
526 const bool changed_security_level = (security_level != security_level_); | 519 const bool changed_security_level = (security_level != security_level_); |
527 | 520 |
528 // Bail early when no visible state will actually change (prevents an | 521 // Bail early when no visible state will actually change (prevents an |
529 // unnecessary ScopedFreeze, and thus UpdateWindow()). | 522 // unnecessary ScopedFreeze, and thus UpdateWindow()). |
530 if (!changed_security_level && !visibly_changed_permanent_text && | 523 if (!changed_security_level && !visibly_changed_permanent_text && |
(...skipping 1951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2482 void AutocompleteEditViewWin::TrackMousePosition(MouseButton button, | 2475 void AutocompleteEditViewWin::TrackMousePosition(MouseButton button, |
2483 const CPoint& point) { | 2476 const CPoint& point) { |
2484 if (gaining_focus_.get()) { | 2477 if (gaining_focus_.get()) { |
2485 // This click is giving us focus, so we need to track how much the mouse | 2478 // This click is giving us focus, so we need to track how much the mouse |
2486 // moves to see if it's a drag or just a click. Clicks should select all | 2479 // moves to see if it's a drag or just a click. Clicks should select all |
2487 // the text. | 2480 // the text. |
2488 tracking_click_[button] = true; | 2481 tracking_click_[button] = true; |
2489 click_point_[button] = point; | 2482 click_point_[button] = point; |
2490 } | 2483 } |
2491 } | 2484 } |
OLD | NEW |