OLD | NEW |
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/toolbar_view.h" | 5 #include "chrome/browser/ui/views/toolbar_view.h" |
6 | 6 |
7 #include "base/i18n/number_formatting.h" | 7 #include "base/i18n/number_formatting.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/command_updater.h" | 10 #include "chrome/browser/command_updater.h" |
11 #include "chrome/browser/event_disposition.h" | 11 #include "chrome/browser/event_disposition.h" |
12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/themes/theme_service.h" | 14 #include "chrome/browser/themes/theme_service.h" |
15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/browser_command_controller.h" | 16 #include "chrome/browser/ui/browser_command_controller.h" |
17 #include "chrome/browser/ui/browser_commands.h" | 17 #include "chrome/browser/ui/browser_commands.h" |
18 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" | 18 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" |
| 19 #include "chrome/browser/ui/browser_instant_controller.h" |
19 #include "chrome/browser/ui/browser_tabstrip.h" | 20 #include "chrome/browser/ui/browser_tabstrip.h" |
20 #include "chrome/browser/ui/browser_window.h" | 21 #include "chrome/browser/ui/browser_window.h" |
21 #include "chrome/browser/ui/global_error/global_error_service.h" | 22 #include "chrome/browser/ui/global_error/global_error_service.h" |
22 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 23 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
23 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 24 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
24 #include "chrome/browser/ui/search/search.h" | 25 #include "chrome/browser/ui/search/search.h" |
25 #include "chrome/browser/ui/search/search_model.h" | 26 #include "chrome/browser/ui/search/search_model.h" |
26 #include "chrome/browser/ui/search/search_tab_helper.h" | 27 #include "chrome/browser/ui/search/search_tab_helper.h" |
27 #include "chrome/browser/ui/search/search_types.h" | 28 #include "chrome/browser/ui/search/search_types.h" |
28 #include "chrome/browser/ui/search/search_ui.h" | 29 #include "chrome/browser/ui/search/search_ui.h" |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 } | 425 } |
425 | 426 |
426 //////////////////////////////////////////////////////////////////////////////// | 427 //////////////////////////////////////////////////////////////////////////////// |
427 // ToolbarView, LocationBarView::Delegate implementation: | 428 // ToolbarView, LocationBarView::Delegate implementation: |
428 | 429 |
429 TabContents* ToolbarView::GetTabContents() const { | 430 TabContents* ToolbarView::GetTabContents() const { |
430 return chrome::GetActiveTabContents(browser_); | 431 return chrome::GetActiveTabContents(browser_); |
431 } | 432 } |
432 | 433 |
433 InstantController* ToolbarView::GetInstant() { | 434 InstantController* ToolbarView::GetInstant() { |
434 return browser_->instant(); | 435 return browser_->instant_controller()->instant(); |
435 } | 436 } |
436 | 437 |
437 ContentSettingBubbleModelDelegate* | 438 ContentSettingBubbleModelDelegate* |
438 ToolbarView::GetContentSettingBubbleModelDelegate() { | 439 ToolbarView::GetContentSettingBubbleModelDelegate() { |
439 return browser_->content_setting_bubble_model_delegate(); | 440 return browser_->content_setting_bubble_model_delegate(); |
440 } | 441 } |
441 | 442 |
442 void ToolbarView::ShowPageInfo(content::WebContents* web_contents, | 443 void ToolbarView::ShowPageInfo(content::WebContents* web_contents, |
443 const GURL& url, | 444 const GURL& url, |
444 const content::SSLStatus& ssl, | 445 const content::SSLStatus& ssl, |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 // LocationBarContainer is not a child of the ToolbarView. | 1001 // LocationBarContainer is not a child of the ToolbarView. |
1001 gfx::Point origin(bounds.origin()); | 1002 gfx::Point origin(bounds.origin()); |
1002 views::View::ConvertPointToView(this, location_bar_container_->parent(), | 1003 views::View::ConvertPointToView(this, location_bar_container_->parent(), |
1003 &origin); | 1004 &origin); |
1004 gfx::Rect target_bounds(origin, bounds.size()); | 1005 gfx::Rect target_bounds(origin, bounds.size()); |
1005 if (location_bar_container_->GetTargetBounds() != target_bounds) { | 1006 if (location_bar_container_->GetTargetBounds() != target_bounds) { |
1006 location_bar_container_->SetInToolbar(true); | 1007 location_bar_container_->SetInToolbar(true); |
1007 location_bar_container_->SetBoundsRect(target_bounds); | 1008 location_bar_container_->SetBoundsRect(target_bounds); |
1008 } | 1009 } |
1009 } | 1010 } |
OLD | NEW |