OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/compact_nav/compact_location_bar_view_host.h" | 5 #include "chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
342 Source<NavigationController>(&tab_contents->controller())); | 342 Source<NavigationController>(&tab_contents->controller())); |
343 } | 343 } |
344 } else { | 344 } else { |
345 StartAutoHideTimer(); | 345 StartAutoHideTimer(); |
346 } | 346 } |
347 } | 347 } |
348 } | 348 } |
349 } | 349 } |
350 | 350 |
351 void CompactLocationBarViewHost::ActiveTabClicked(int index) { | 351 void CompactLocationBarViewHost::ActiveTabClicked(int index) { |
352 UpdateOnTabChange(index, true); | 352 // On active tab click, show the compact location bar and also select all the |
353 // contents for quick editing. | |
354 browser_view()->SetFocusToLocationBar(true); | |
MAD
2011/05/25 00:21:18
Feels a bit weird to have to go back to the browse
SteveT
2011/05/25 04:16:42
Agreed. I forgot that the CLBView had a method to
| |
353 } | 355 } |
354 | 356 |
355 //////////////////////////////////////////////////////////////////////////////// | 357 //////////////////////////////////////////////////////////////////////////////// |
356 // CompactLocationBarViewHost, NotificationObserver implementation: | 358 // CompactLocationBarViewHost, NotificationObserver implementation: |
357 | 359 |
358 void CompactLocationBarViewHost::Observe(NotificationType type, | 360 void CompactLocationBarViewHost::Observe(NotificationType type, |
359 const NotificationSource& source, | 361 const NotificationSource& source, |
360 const NotificationDetails& details) { | 362 const NotificationDetails& details) { |
361 switch (type.value) { | 363 switch (type.value) { |
362 case NotificationType::LOAD_STOP: { | 364 case NotificationType::LOAD_STOP: { |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
508 bool CompactLocationBarViewHost::IsCurrentTabIndex(int index) { | 510 bool CompactLocationBarViewHost::IsCurrentTabIndex(int index) { |
509 return current_tab_model_index_ == index; | 511 return current_tab_model_index_ == index; |
510 } | 512 } |
511 | 513 |
512 bool CompactLocationBarViewHost::IsCurrentTab(TabContents* contents) { | 514 bool CompactLocationBarViewHost::IsCurrentTab(TabContents* contents) { |
513 TabStripModel* tab_strip_model = browser_view()->browser()->tabstrip_model(); | 515 TabStripModel* tab_strip_model = browser_view()->browser()->tabstrip_model(); |
514 return tab_strip_model->ContainsIndex(current_tab_model_index_) && | 516 return tab_strip_model->ContainsIndex(current_tab_model_index_) && |
515 tab_strip_model->GetTabContentsAt(current_tab_model_index_)-> | 517 tab_strip_model->GetTabContentsAt(current_tab_model_index_)-> |
516 tab_contents() == contents; | 518 tab_contents() == contents; |
517 } | 519 } |
OLD | NEW |