| 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/tabs/browser_tab_strip_controller.h" | 5 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/task_runner_util.h" | 9 #include "base/task_runner_util.h" |
| 10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 // Use autocomplete to clean up the text, going so far as to turn it into | 367 // Use autocomplete to clean up the text, going so far as to turn it into |
| 368 // a search query if necessary. | 368 // a search query if necessary. |
| 369 AutocompleteMatch match; | 369 AutocompleteMatch match; |
| 370 AutocompleteClassifierFactory::GetForProfile(profile())->Classify( | 370 AutocompleteClassifierFactory::GetForProfile(profile())->Classify( |
| 371 location, false, false, metrics::OmniboxEventProto::BLANK, &match, NULL); | 371 location, false, false, metrics::OmniboxEventProto::BLANK, &match, NULL); |
| 372 if (match.destination_url.is_valid()) | 372 if (match.destination_url.is_valid()) |
| 373 model_->delegate()->AddTabAt(match.destination_url, -1, true); | 373 model_->delegate()->AddTabAt(match.destination_url, -1, true); |
| 374 } | 374 } |
| 375 | 375 |
| 376 bool BrowserTabStripController::IsIncognito() { | 376 bool BrowserTabStripController::IsIncognito() { |
| 377 return browser_->profile()->IsOffTheRecord(); | 377 return browser_->profile()->GetProfileType() == Profile::INCOGNITO_PROFILE; |
| 378 } | 378 } |
| 379 | 379 |
| 380 void BrowserTabStripController::StackedLayoutMaybeChanged() { | 380 void BrowserTabStripController::StackedLayoutMaybeChanged() { |
| 381 bool adjust_layout = false; | 381 bool adjust_layout = false; |
| 382 bool stacked_layout = DetermineTabStripLayoutStacked( | 382 bool stacked_layout = DetermineTabStripLayoutStacked( |
| 383 g_browser_process->local_state(), &adjust_layout); | 383 g_browser_process->local_state(), &adjust_layout); |
| 384 if (!adjust_layout || stacked_layout == tabstrip_->stacked_layout()) | 384 if (!adjust_layout || stacked_layout == tabstrip_->stacked_layout()) |
| 385 return; | 385 return; |
| 386 | 386 |
| 387 g_browser_process->local_state()->SetBoolean(prefs::kTabStripStackedLayout, | 387 g_browser_process->local_state()->SetBoolean(prefs::kTabStripStackedLayout, |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 content::WebPluginInfo plugin; | 571 content::WebPluginInfo plugin; |
| 572 tabstrip_->FileSupported( | 572 tabstrip_->FileSupported( |
| 573 url, | 573 url, |
| 574 mime_type.empty() || mime_util::IsSupportedMimeType(mime_type) || | 574 mime_type.empty() || mime_util::IsSupportedMimeType(mime_type) || |
| 575 content::PluginService::GetInstance()->GetPluginInfo( | 575 content::PluginService::GetInstance()->GetPluginInfo( |
| 576 -1, // process ID | 576 -1, // process ID |
| 577 MSG_ROUTING_NONE, // routing ID | 577 MSG_ROUTING_NONE, // routing ID |
| 578 model_->profile()->GetResourceContext(), url, GURL(), mime_type, | 578 model_->profile()->GetResourceContext(), url, GURL(), mime_type, |
| 579 false, NULL, &plugin, NULL)); | 579 false, NULL, &plugin, NULL)); |
| 580 } | 580 } |
| OLD | NEW |