| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/instant/instant_loader.h" | 5 #include "chrome/browser/instant/instant_loader.h" |
| 6 | 6 |
| 7 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 7 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 8 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" | 8 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" |
| 9 #include "chrome/browser/favicon/favicon_tab_helper.h" | 9 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 10 #include "chrome/browser/history/history_tab_helper.h" | 10 #include "chrome/browser/history/history_tab_helper.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 void InstantLoader::SetPopupBounds(const gfx::Rect& bounds) { | 243 void InstantLoader::SetPopupBounds(const gfx::Rect& bounds) { |
| 244 client_.SetPopupBounds(bounds); | 244 client_.SetPopupBounds(bounds); |
| 245 } | 245 } |
| 246 | 246 |
| 247 void InstantLoader::SetMarginSize(int start, int end) { | 247 void InstantLoader::SetMarginSize(int start, int end) { |
| 248 client_.SetMarginSize(start, end); | 248 client_.SetMarginSize(start, end); |
| 249 } | 249 } |
| 250 | 250 |
| 251 void InstantLoader::InitializeFonts() { |
| 252 client_.InitializeFonts(); |
| 253 } |
| 254 |
| 251 void InstantLoader::SendAutocompleteResults( | 255 void InstantLoader::SendAutocompleteResults( |
| 252 const std::vector<InstantAutocompleteResult>& results) { | 256 const std::vector<InstantAutocompleteResult>& results) { |
| 253 client_.SendAutocompleteResults(results); | 257 client_.SendAutocompleteResults(results); |
| 254 } | 258 } |
| 255 | 259 |
| 256 void InstantLoader::UpOrDownKeyPressed(int count) { | 260 void InstantLoader::UpOrDownKeyPressed(int count) { |
| 257 client_.UpOrDownKeyPressed(count); | 261 client_.UpOrDownKeyPressed(count); |
| 258 } | 262 } |
| 259 | 263 |
| 260 void InstantLoader::SearchModeChanged(const chrome::search::Mode& mode) { | 264 void InstantLoader::SearchModeChanged(const chrome::search::Mode& mode) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 void InstantLoader::AboutToNavigateMainFrame(const GURL& url) { | 321 void InstantLoader::AboutToNavigateMainFrame(const GURL& url) { |
| 318 controller_->InstantLoaderAboutToNavigateMainFrame(url); | 322 controller_->InstantLoaderAboutToNavigateMainFrame(url); |
| 319 } | 323 } |
| 320 | 324 |
| 321 void InstantLoader::NavigateToURL(const GURL& url, | 325 void InstantLoader::NavigateToURL(const GURL& url, |
| 322 content::PageTransition transition) { | 326 content::PageTransition transition) { |
| 323 InstantSupportDetermined(true); | 327 InstantSupportDetermined(true); |
| 324 controller_->NavigateToURL(url, transition); | 328 controller_->NavigateToURL(url, transition); |
| 325 } | 329 } |
| 326 | 330 |
| 331 void InstantLoader::RenderViewCreated() { |
| 332 controller_->InstantLoaderRenderViewCreated(); |
| 333 } |
| 334 |
| 327 void InstantLoader::Observe(int type, | 335 void InstantLoader::Observe(int type, |
| 328 const content::NotificationSource& source, | 336 const content::NotificationSource& source, |
| 329 const content::NotificationDetails& details) { | 337 const content::NotificationDetails& details) { |
| 330 #if defined(OS_MACOSX) | 338 #if defined(OS_MACOSX) |
| 331 if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) { | 339 if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) { |
| 332 if (content::RenderWidgetHostView* rwhv = | 340 if (content::RenderWidgetHostView* rwhv = |
| 333 contents_->GetRenderWidgetHostView()) | 341 contents_->GetRenderWidgetHostView()) |
| 334 rwhv->SetTakesFocusOnlyOnMouseDown(true); | 342 rwhv->SetTakesFocusOnlyOnMouseDown(true); |
| 335 return; | 343 return; |
| 336 } | 344 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 content::WebContents* new_contents) { | 419 content::WebContents* new_contents) { |
| 412 DCHECK_EQ(old_contents, contents()); | 420 DCHECK_EQ(old_contents, contents()); |
| 413 CleanupPreviewContents(); | 421 CleanupPreviewContents(); |
| 414 // We release here without deleting so that the caller still has the | 422 // We release here without deleting so that the caller still has the |
| 415 // responsibility for deleting the WebContents. | 423 // responsibility for deleting the WebContents. |
| 416 ignore_result(contents_.release()); | 424 ignore_result(contents_.release()); |
| 417 contents_.reset(new_contents); | 425 contents_.reset(new_contents); |
| 418 SetupPreviewContents(); | 426 SetupPreviewContents(); |
| 419 controller_->SwappedWebContents(); | 427 controller_->SwappedWebContents(); |
| 420 } | 428 } |
| OLD | NEW |