| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 | 8 |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 10 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 release_browser_window(); | 317 release_browser_window(); |
| 318 BrowserViewTest::TearDown(); | 318 BrowserViewTest::TearDown(); |
| 319 browser_view_ = NULL; | 319 browser_view_ = NULL; |
| 320 } | 320 } |
| 321 | 321 |
| 322 virtual BrowserWindow* CreateBrowserWindow() OVERRIDE { | 322 virtual BrowserWindow* CreateBrowserWindow() OVERRIDE { |
| 323 // We need an incognito profile for the window switcher button to be | 323 // We need an incognito profile for the window switcher button to be |
| 324 // visible. | 324 // visible. |
| 325 // This profile instance is owned by the TestingProfile instance within the | 325 // This profile instance is owned by the TestingProfile instance within the |
| 326 // BrowserWithTestWindowTest class. | 326 // BrowserWithTestWindowTest class. |
| 327 TestingProfile* incognito_profile = new TestingProfile(); | 327 TestingProfile::Builder builder; |
| 328 incognito_profile->set_incognito(true); | 328 builder.SetIncognito(); |
| 329 GetProfile()->SetOffTheRecordProfile(incognito_profile); | 329 GetProfile()->SetOffTheRecordProfile(builder.Build()); |
| 330 | 330 |
| 331 browser_view_ = new TestBrowserView(); | 331 browser_view_ = new TestBrowserView(); |
| 332 browser_view_->SetWindowSwitcherButton( | 332 browser_view_->SetWindowSwitcherButton( |
| 333 MakeWindowSwitcherButton(NULL, false)); | 333 MakeWindowSwitcherButton(NULL, false)); |
| 334 return browser_view_; | 334 return browser_view_; |
| 335 } | 335 } |
| 336 | 336 |
| 337 private: | 337 private: |
| 338 BrowserView* browser_view_; | 338 BrowserView* browser_view_; |
| 339 | 339 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 353 // Test initial state. | 353 // Test initial state. |
| 354 EXPECT_TRUE(browser_view()->IsTabStripVisible()); | 354 EXPECT_TRUE(browser_view()->IsTabStripVisible()); |
| 355 // Validate whether the window switcher button is the target for the position | 355 // Validate whether the window switcher button is the target for the position |
| 356 // passed in. | 356 // passed in. |
| 357 gfx::Point switcher_point(browser_view()->window_switcher_button()->x() + 2, | 357 gfx::Point switcher_point(browser_view()->window_switcher_button()->x() + 2, |
| 358 browser_view()->window_switcher_button()->y()); | 358 browser_view()->window_switcher_button()->y()); |
| 359 EXPECT_EQ(browser_view()->GetEventHandlerForPoint(switcher_point), | 359 EXPECT_EQ(browser_view()->GetEventHandlerForPoint(switcher_point), |
| 360 browser_view()->window_switcher_button()); | 360 browser_view()->window_switcher_button()); |
| 361 } | 361 } |
| 362 #endif | 362 #endif |
| OLD | NEW |