Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Side by Side Diff: ui/views/focus/focus_manager_unittest.cc

Issue 10134036: Let Chrome app handle Ash accelerators first if the app is launched as a window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final rebase Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/focus/focus_manager_factory.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/utf_string_conversions.h" 5 #include "base/utf_string_conversions.h"
6 #include "ui/base/accelerators/accelerator.h" 6 #include "ui/base/accelerators/accelerator.h"
7 #include "ui/base/keycodes/keyboard_codes.h" 7 #include "ui/base/keycodes/keyboard_codes.h"
8 #include "ui/views/controls/button/text_button.h" 8 #include "ui/views/controls/button/text_button.h"
9 #include "ui/views/controls/textfield/textfield.h" 9 #include "ui/views/controls/textfield/textfield.h"
10 #include "ui/views/focus/accelerator_handler.h" 10 #include "ui/views/focus/accelerator_handler.h"
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 EXPECT_EQ(target.accelerator_count(), 1); 495 EXPECT_EQ(target.accelerator_count(), 1);
496 } 496 }
497 497
498 class FocusManagerDtorTest : public FocusManagerTest { 498 class FocusManagerDtorTest : public FocusManagerTest {
499 protected: 499 protected:
500 typedef std::vector<std::string> DtorTrackVector; 500 typedef std::vector<std::string> DtorTrackVector;
501 501
502 class FocusManagerDtorTracked : public FocusManager { 502 class FocusManagerDtorTracked : public FocusManager {
503 public: 503 public:
504 FocusManagerDtorTracked(Widget* widget, DtorTrackVector* dtor_tracker) 504 FocusManagerDtorTracked(Widget* widget, DtorTrackVector* dtor_tracker)
505 : FocusManager(widget), 505 : FocusManager(widget, NULL /* delegate */),
506 dtor_tracker_(dtor_tracker) { 506 dtor_tracker_(dtor_tracker) {
507 } 507 }
508 508
509 virtual ~FocusManagerDtorTracked() { 509 virtual ~FocusManagerDtorTracked() {
510 dtor_tracker_->push_back("FocusManagerDtorTracked"); 510 dtor_tracker_->push_back("FocusManagerDtorTracked");
511 } 511 }
512 512
513 DtorTrackVector* dtor_tracker_; 513 DtorTrackVector* dtor_tracker_;
514 514
515 private: 515 private:
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 598
599 // Test window, button and focus manager should all be destructed. 599 // Test window, button and focus manager should all be destructed.
600 ASSERT_EQ(3, static_cast<int>(dtor_tracker_.size())); 600 ASSERT_EQ(3, static_cast<int>(dtor_tracker_.size()));
601 601
602 // Focus manager should be the last one to destruct. 602 // Focus manager should be the last one to destruct.
603 ASSERT_STREQ("FocusManagerDtorTracked", dtor_tracker_[2].c_str()); 603 ASSERT_STREQ("FocusManagerDtorTracked", dtor_tracker_[2].c_str());
604 } 604 }
605 #endif 605 #endif
606 606
607 } // namespace views 607 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/focus/focus_manager_factory.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698